原創|使用教程|編輯:鄭恭琳|2019-10-29 15:45:25.663|閱讀 212 次
概述:本示例說明如何更改報表查看器的外觀。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
立即點擊下載Stimulsoft Reports.Flex最新版
本示例說明如何更改報表查看器的外觀。為了從代碼創建和顯示查看器,您將需要調用StiViewerFx.initialize()靜態方法。在應用程序的initialize事件中調用此方法:
<mx:Application xmlns:mx="//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); }
在下面的屏幕截圖中,您可以看到示例代碼的結果。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn