Cloud
Cloud-Dienstleistung für schnelle und effektive Analyse und Visualisierung von Daten für Ihr Business ohne eigene Applikationen zu erstellen oder zu programmieren.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Viewer.aspx.cs" Inherits="Connect_to_Data_from_the_Code.Viewer" %>
<%@ Register assembly="Stimulsoft.Report.Web" namespace="Stimulsoft.Report.Web" tagprefix="cc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<cc1:StiWebViewer ID="StiWebViewer1" runat="server"
OnGetReport="StiWebViewer1_GetReport" />
</form>
</body>
</html>
Load() method to load the report template and delete all connections with Clear():
protected void StiWebViewer1_GetReport(object sender, StiReportDataEventArgs e)
{
// Loading the report template
var reportPath = Server.MapPath("Reports/SimpleList.mrt");
var report = new StiReport();
report.Load(reportPath);
// Deleting connections in the report template
report.Dictionary.Databases.Clear();
...
ReadXml() and register it in the report with RegData():
...
// 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();
e.Report = report;
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Designer.aspx.cs" Inherits="Connect_to_Data_from_the_Code.Designer" %>
<%@ Register assembly="Stimulsoft.Report.WebDesigner" namespace="Stimulsoft.Report.Web" tagprefix="cc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<cc1:StiWebViewer ID="StiWebDesigner1" runat="server"
OnGetReport="StiWebDesigner1_GetReport"
OnPreviewReport="StiWebDesigner1_PreviewReport" />
</form>
</body>
</html>
protected void StiWebDesigner1_GetReport(object sender, StiReportDataEventArgs e)
{
// Loading the report template
var reportPath = Server.MapPath("Reports/SimpleList.mrt");
var report = new StiReport();
report.Load(reportPath);
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();
}