Displaying errors to users

Stimulsoft Reports.Silverlight discussion
Locked
1sttouch
Posts: 1
Joined: Wed Nov 16, 2011 6:45 am
Location: England

Displaying errors to users

Post by 1sttouch »

Hi,

I am in the process of evaluating the Silverlight Report Designer and also the Web ViewerControl for use within our product. I have managed to design a report, save it to a sql database (as an xml string) and load it back up again into the designer. One of the problems I have (there are a few at the moment but this is the largest issue) is when making sure the report compiles / renders; I would like to show the user the errors so they know the report didnt save successfully. It might not be obvious from above so i'll outline that I am overriding the LoadReport and SaveReport methods so we can perform version management on the designed reports.

Bit of Pseudocode ...

Code: Select all

void Load()
{
    //get report from the database
    string reportDefinition = Db.GetReport();    

    StiReport report = new StiReport();
    report.LoadFromString(reportDefinition);

    StiWebDesignerSL1.Report = report;
}

void Save(object sender, StiSaveReportEventArgs e)
{
    try
    {
        report.Compile();
    }
    catch(Exception ex)
    {
        //somehow show report.CompileResults to the user?
        throw;//do not save the report to the db
    }
    
    //save the valid report to the database
    string reportDefinition = report.SaveToString();
    DB.SaveReport(reportDefinition);
}
The reason why I can't just show a javascript alert to the user is because a new request has been created by the silverlight application when SaveReport event is fired. This means I cannot access any of the server controls within the delegate method. In addition, it appears that the silverlight control Report property StiWebDesignerSL.Report is not synchronised with changes made to the report, so I cannot check for compile errors on a server postback / button click, or even whether the report has changed StiWebDesignerSL.Report.ReportChanged.

Are you able to help? Is what im asking even possible?

Regards

Paul

ps. a bit of an annoyance is how the new request made to SaveReport on the web application. Each request made replaces the querystring with a new one specific to the saving of the report. Is there any way of maintaining the querystring parameters on requests made by the silverlight application?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Displaying errors to users

Post by Alex K. »

Hello,

We need some time for check the issue.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Displaying errors to users

Post by HighAley »

Hello.

We'll make changes and add the option to return either a list of compilation errors or a list of error messages in ReportChecker.
This fix will be available next week.

Thank you.
Locked