【Stimulsoft Reports Flex教程】在运行时创建查看器

此示例显示如何在运行时从代码创建 表查看器。

下载Stimulsoft Reports Flex最新版本

首先,您需要创建StiViewerFx类的新查看器对象。您还可以设置查看器对象的必要参数,例如其位置。创建后,您可以使用addElement()方法将查看器可视对象添加到应用程序的主容器中:

private var _viewer: StiViewerFx;public function get viewer(): StiViewerFx{    return _viewer;}public function set viewer(value: StiViewerFx): void{    _viewer = value;}private function createViewerFx(): void{    // Create new ViewerFx    viewer = new StiViewerFx;    // Set ViewerFx location    viewer.left = 0;    viewer.top = 0;    viewer.right = 0;    viewer.bottom = 0;    // Hide Close button on viewer toolbar    StiOptions.viewer.toolbar.showExitButton = false;    // Add ViewerFx to Application    addElement(viewer);}

要使用 表查看器的此实例,您可以访问viewer属性:

private function onLoadComplete(event: Event): void{    ...    // Create new report object    var report: StiReport = new StiReport();    // Load document from XML string    report.loadDocumentFromString(documentString);    // Show report in ViewerFx    viewer.report = report;}

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

Stimulsoft

下载示例

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

GrapeCity年末福利大放送
标签: 表 表控件Stimulsoft

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2018年11月17日
下一篇 2018年11月17日

相关推荐

发表回复

登录后才能评论