protected void StiWebDesigner1_Exit(object sender, StiReportDataEventArgs e) { string keyValue = Page.Request.QueryString.Get("reportname"); if (keyValue == null) { keyValue = "DashboardChristmas"; } this.Response.Redirect("Viewer.aspx?reportname=" + keyValue, true); }
// DataSet for preview report in Web Designer protected void StiWebDesignerFx1_PreviewReport(object sender, StiReportDataEventArgs e) { string applicationDirectory = HttpContext.Current.Server.MapPath(string.Empty); DataSet data = new DataSet(); data.ReadXml(applicationDirectory + "\\Data\\Demo.xml"); data.ReadXmlSchema(applicationDirectory + "\\Data\\Demo.xsd"); e.Report.RegData(data); }
protected void StiWebViewer1_GetReport(object sender, StiReportDataEventArgs e) { var report = StiReport.CreateNewDashboard(); var reportName = "DashboardChristmas"; if (!string.IsNullOrEmpty(Page.Request.QueryString.Get("reportname"))) { reportName = Page.Request.QueryString.Get("reportname"); } report.Load(string.Format("{0}\\Dashboards\\{1}.mrt", appDirectory, reportName)); e.Report = report; }
protected void StiWebDesigner1_GetReport(object sender, StiReportDataEventArgs e) { var report = new StiReport(); report.Load(Server.MapPath(@"Reports\MyInvoice.mrt")); // Add System.Web.dll library to the report references var assemblies = new string[report.ReferencedAssemblies.Length + 1]; Array.Copy(report.ReferencedAssemblies, assemblies, report.ReferencedAssemblies.Length); assemblies[assemblies.Length - 1] = "System.Web.dll"; report.ReferencedAssemblies = assemblies; e.Report = report; }
protected void StiWebDesigner1_PreviewReport(object sender, StiReportDataEventArgs e) { // Getting a preview report var report = e.Report; // Deleting connections in the report template report.Dictionary.Databases.Clear(); // Loading data from the XML file var dataPath = Server.MapPath("Data/Demo.xml"); var data = new DataSet(); data.ReadXml(dataPath); // Registering data in the report report.RegData(data); // Syncing the data structure, if required //report.Dictionary.Synchronize(); }
protected void StiReportViewer_GetReportData(object sender, StiReportDataEventArgs e) { string[] retMessage = new string[4]; try { if (IsPostBack) { if (Session[e.Report.ReportName] != null) { e.Report.RegData((DataTable)Session[e.Report.ReportName]); } } } catch (Exception ex) { Response.Clear(); retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); Response.Write(this.exceptionHandler.CreateErrorMessage(retMessage)); Response.Flush(); } }
protected void StiWebViewer1_GetReport(object sender, StiReportDataEventArgs e) { // Create new dashboard var report = StiReport.CreateNewDashboard(); // Load dashboard template report.Load(Server.MapPath("Dashboards/Dashboard.mrt")); // Load a JSON file var jsonBytes = File.ReadAllBytes(Server.MapPath("Dashboards/Demo.json")); // Get DataSet from JSON file var json = StiJsonConnector.Get(); var dataSet = json.GetDataSet(new StiJsonOptions(jsonBytes)); // Remove all connections from the dashboard template report.Dictionary.Databases.Clear(); // Register DataSet object report.RegData("Demo", "Demo", dataSet); // Show dashboard in the Web Viewer e.Report = report; }
protected void StiWebDesignerFx1_Exit(object sender, StiReportDataEventArgs e) { // This event need to handle Exit on the server side }
protected void StiWebDesigner1_PreviewReport(object sender, StiReportDataEventArgs e) { }