本示例说明如何更改 表查看器的外观。
本示例说明如何更改 表查看器的外观。为了从代码创建和显示查看器,您将需要调用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);}
在下面的屏幕截图中,您可以看到示例代码的结果。

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