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();    ...}

要自定义报表查看器,您可以从StiOptions类中更改静态选项。例如,以下代码根据复选框的值启用或禁用查看器某些元素的可见性:

private function onShowCustomizedViewerClick(): void{    // Create new report object    var report: StiReport = new StiReport();    // Load document from XML string    report.loadDocumentFromString(documentString);     // Customize Viewer toolbar    StiOptions.viewer.toolbar.showPrintButton = checkBoxShowPrintButton.selected;    StiOptions.viewer.toolbar.showOpenButton = checkBoxShowOpenButton.selected;    StiOptions.viewer.toolbar.showSaveButton = checkBoxShowSaveButton.selected;    StiOptions.viewer.toolbar.showBookmarksButton = checkBoxShowBookmarksButton.selected;    StiOptions.viewer.toolbar.showParametersButton = checkBoxShowParametersButton.selected;    StiOptions.viewer.toolbar.showThumbnailsButton = checkBoxShowThumbnailsButton.selected;    StiOptions.viewer.toolbar.showFindButton = checkBoxShowFindButton.selected;    StiOptions.viewer.toolbar.showExitButton = checkBoxShowExitButton.selected;    StiOptions.viewer.toolbar.showAboutButton = checkBoxShowAboutButton.selected;    StiOptions.viewer.toolbar.showFirstPageButton = checkBoxShowFirstPageButton.selected;    StiOptions.viewer.toolbar.showPreviousPageButton = checkBoxShowPreviousPageButton.selected;    StiOptions.viewer.toolbar.showGoToPageButton = checkBoxShowGoToPageButton.selected;    StiOptions.viewer.toolbar.showNextPageButton = checkBoxShowNextPageButton.selected;    StiOptions.viewer.toolbar.showLastPageButton = checkBoxShowLastPageButton.selected;    StiOptions.viewer.toolbar.showPageViewModeSingleButton = checkBoxShowPageViewModeSingleButton.selected;    StiOptions.viewer.toolbar.showPageViewModeContinuousButton = checkBoxShowPageViewModeContinuousButton.selected;    StiOptions.viewer.toolbar.showPageViewModeMultipleButton = checkBoxShowPageViewModeMultipleButton.selected;    StiOptions.viewer.toolbar.showZoom = checkBoxShowZoom.selected;    // Create bounds of Viewer window    var rect: Rectangle = new Rectangle(100, 100, 900, 600);    // Show report in Viewer dialog window    report.showDialog(rect, "Customized ViewerFx", true, true);}

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

Stimulsoft Reports Flex教程:自定义报表查看器

下载示例

标签:

来源:慧都

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

上一篇 2019年9月26日
下一篇 2019年9月26日

相关推荐

发表回复

登录后才能评论