Download Stimulsoft Reports

Transcript
Stimulsoft Reports Product Line
User Manual
793
protected void StiWebDesigner1_GetPreviewDataSet(object sender,
StiWebDesigner.StiPreviewDataSetEventArgs e)
{
DataSet data = new DataSet();
data.ReadXml("D:\\Demo.xml");
data.ReadXmlSchema("D:\\Demo.xsd");
e.PreviewDataSet = data;
}
VB.NET:
Protected Sub StiWebDesigner1_GetPreviewDataSet(ByVal sender As Object,
ByVal e As StiWebDesigner.StiPreviewDataSetEventArgs)
Dim data As DataSet = New DataSet()
data.ReadXml("D:\\Demo.xml")
data.ReadXmlSchema("D:\\Demo.xsd")
e.PreviewDataSet = data
End Sub
As seen from code, data are taken from XML and XSD files. The same way exists for other data
sources.
5.5.
Changing Report Settings BeforeRendering
If it is necessary before the report rendering to change the report parameters or user settings in the
report, you can add a handler to the ProcessReportBeforeRender event. This event occurs
immediately before the report rendering. For example, it is necessary to change the Report Name
before report rendering. To do this, add the handler to the ProcessReportBeforeRender event,
define the value of the ReportName property, where the value of the property is the name of the
report. For example, add the following code to the code project:
protected void StiWebDesigner1_ProcessReportBeforeRender(object sender, StiWebDesigner.
StiProcessReportBeforeRenderEventArgs e)
{
e.Report.ReportName = "Employees";
}
Now, before report rendering, the name will be changed from the existing one to Report 2010. Thus,
using the ProcessReportBeforeRender event, the user can change custom options before
rendering.
© 2003-2011 Stimulsoft