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?