【Stimulsoft Reports Flex教程】在查看器中显示报表

此示例显示如何在查看器中显示报表。要从代码创建和显示查看器,您需要调用StiViewerFx.initialize() 静态方法。

下载Stimulsoft Reports Flex最新版本

此示例显示如何在查看器中显示报表。要从代码创建和显示查看器,您需要调用StiViewerFx.initialize() 静态方法。在应用程序的initialize事件中调用此方法:

<mx:Application    xmlns_mx="http://www.adobe.com/2006/mxml" layout="absolute"    minWidth="1024" minHeight="768" backgroundColor="#e8e8e8"    initialize="onInitialize()" xmlns_viewer="stimulsoft.viewer.*">
private function onInitialize(): void{    StiViewerFx.initialize();    ...}

要首先在查看器中显示报表,您需要加载报表文件,例如将其分配给reportString变量。接下来,您需要使用loadReportFromString()方法创建StiReport对象并从此字符串变量加载报表。完成这些操作后,您可以使用show()方法在查看器中显示报表,报表remplate将自动构建:

private function onViewReportClick(): void{    // Create new report object    var report: StiReport = new StiReport();    // Load report from XML string    report.loadReportFromString(reportString);    // Show report in Viewer    report.show();}

您还可以在查看器中将报表显示为对话框窗口。只需将show()方法更改为showDialog()方法,所有其他操作都是相同的:

private function onViewInDialogWindowClick(): void{    // Create new report object    var report: StiReport = new StiReport();    // Load report from XML string    report.loadReportFromString(reportString);    // Show report in Viewer dialog window    report.showDialog();}

下面的屏幕截图中,您可以看到示例代码的结果。

Stimulsoft

下载示例

购买Stimulsoft正版授权,请点击“咨询在线客服”哟!

Codemix活动
标签:报表报表控件Stimulsoft

来源:慧都网

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2019年1月1日
下一篇 2019年1月1日

相关推荐

发表回复

登录后才能评论