Page 1 of 1

report compile

Posted: Sat Apr 18, 2009 5:43 am
by srini_morapaka
Hai,

I am designing a report and storing the report template in sql express database.
After designing and compiling the report, i want to store the report template in the database, if the report does not have any errors.
If the report has any errors, i should not allow the report to be saved.

how do i find whether the report has any errors.

thanks in advance
Srinivas

report compile

Posted: Sat Apr 18, 2009 6:10 am
by Brendan
You could wrap the Render() method in a try/catch block to supress any exceptions and then check the report.IsRendered property for true or false.

Code: Select all

try
{
    report.Render(false);
}
catch {}

Console.WriteLine("Report Rendered: {0}", report.IsRendered);
If report.IsRendered is true then it should be ok. As far as I know, if there's an error in the report it will throw an exception during the render process.