作者:mayz 来源:Stimulsoft 浏览:Loading... 日期:2012-11-06
在Stimulsoft报表设计器中,你可以将报表以集合的形式(DLL-file)组装起来。要在应用程序中使用报表,添加以下代码:
C#
StiReport report = StiReport.GetReportFromAssembly("MyReport.dll", true);
另外,你也可以在第一次访问时编译报表,在下次使用时你就可以使用已被编译的报表。请参考以下代码:
C#
string reportName = "MyReport.mrt";
string reportDllName = "MyReport.dll";
StiReport report = null;
// if report dll is not exists ...
if (!File.Exists(reportDllName))
{
// load report definition
report = new StiReport();
report.Load(reportName);
// compile report, save dll version of report
report.Compile(reportDllName);
}
else // if report assembly is available …
{
// … use it
report = StiReport.GetReportFromAssembly(reportDllName);
}
VB
Dim ReportName As String = "MyReport.mrt"
Dim ReportDllName As String = "MyReport.dll"
Dim Report As StiReport = Nothing
' if report dll is not exists ...
If Not File.Exists(ReportDllName) Then
' load report definition
Report = New StiReport
Report.Load(ReportName)
' compile report, save dll version of report
Report.Compile(ReportDllName)
Else
' if report assembly is available …
Report = StiReport.GetReportFromAssembly(ReportName)
End If
Tag标签:.Net报表 Stimulsoft Reports.Net
上一篇: 如何访问Stimulsoft Reports变量值(代码示例)
下一篇: 四款.Net报表控件对比评测