Displaying errors to users
Posted: Wed Nov 16, 2011 7:14 am
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 ...
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?
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);
}
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?