Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Tuesday, March 27, 2012

Error When setting Map Document Label in a group of a table

Hi,

I try to activate the map document control on my report. My Report is composed of a table in which I group by 2 criterias. When I set the document map label of the first entry of the group list then I get an error on the preview :

"An internal error occurred on the report server. See the error log for more details. "

Can someone tell where can I find the error log file ?

thanks in Advance.

Depending on what drive you set up sql server on and what instance you are referring to (if there is more than one), the basic path to the log files is:

C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\LogFiles

You can also view the logs on the reporting services server in the Event Viewer.

|||thanks Simone

Friday, February 24, 2012

Error trapping of datasource control

Hello,

I encountered an interesting situation. I have a gridview and a sqldatasource. It has delete function. When I delete a record an error of foreign key violation is raised. I would like to trap this error and give a user friendly message to the user.

If I use ADO.Net I can use Try/Catch, but it seems there is no way to do the same thing using datasource. Anyone knows?

Thank you,

J

void CustomersGridView_RowDeleted(Object sender, GridViewDeletedEventArgs e)
{

// Display whether the delete operation succeeded.
if(e.Exception ==null)
{
Message.Text ="Row deleted successfully.";
}
else
{
Message.Text ="An error occurredwhile attempting to delete the row.";
e.ExceptionHandled =true;
}

}

Take a look@.MSDNhttp://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdeleted.aspx
|||

Hosam,

Thank you for the reply. It helps, but I would like to get more specific message and give users a friendly message based on that. That is, how can I know the exception is raised due to foreign key violation specifically for example?

Or is there any way to trap the error message passed by a stored procedure?

Thank you,

J

|||

What about check forConstraintException

http://msdn2.microsoft.com/en-us/library/system.data(VS.71).aspx

http://msdn2.microsoft.com/en-us/library/system.data.constraintexception(VS.71).aspx

|||

That is a good suggestion. I will read them.

By the way, thinking for a little time your previous answer does not make sense. The exception is handled after row is ALREADY deleted?

|||

But note that if this exception was thrown nor record will be deleted as the constraint will prevent this.

So if the exception exists no records actually deleted.

|||

Thank you, Hosam.

I tested with detailsview's inserted event, but it did not work. However, what you were saying makes sense as well. I will look into details. If I find more new things, I wll post it here. Thank you.

J