Designer Events
Information |
Since dashboards and reports use the same unified template format - MRT, methods for loading the template and working with data, the word “report” will be used in the documentation text.
|
The HTML5 Designer component supports events that allow you to execute necessary operations before specific actions, such as creating and editing report templates, previewing, printing and exporting, interactivity, etc. Below is a sample for processing designer events.
Default.aspx |
... <cc1:StiWebDesigner ID="StiWebDesigner1" runat="server" OnGetReport="StiWebDesigner1_GetReport" OnCreateReport="StiWebDesigner1_CreateReport" OnSaveReport="StiWebDesigner1_SaveReport"> </cc1:StiWebDesigner> ... |
Default.aspx.cs |
... protected void StiWebDesigner1_GetReport(object sender, StiReportDataEventArgs e) { StiReport report = new StiReport(); report.Load(Server.MapPath("Reports/SimpleList.mrt"));
e.Report = report; }
protected void StiWebDesigner1_CreateReport(object sender, StiReportDataEventArgs e) { DataSet data = new DataSet(); data.ReadXmlSchema(Server.MapPath("Data/Demo.xsd")); data.ReadXml(Server.MapPath("Data/Demo.xml"));
e.Report.RegData(data); e.Report.Dictionary.Synchronize(); }
protected void StiWebDesigner1_SaveReport(object sender, StiReportDataEventArgs e) { try { e.Report.Save(Server.MapPath("Reports/" + e.Report.ReportName + ".mrt")); } catch (Exception ex) { e.ErrorString = ex.Message; } } ... |
Events
|