原創(chuàng)|使用教程|編輯:王香|2018-08-09 15:05:59.000|閱讀 1581 次
概述:本文主要講解了如何在Stimulsoft中更改報(bào)表設(shè)計(jì)器主題、設(shè)計(jì)器事件、在Designer中編輯報(bào)表模板和Designer中的全屏模式
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
【下載Stimulsoft Reports.JS最新版本】
此示例顯示如何更改設(shè)計(jì)器默認(rèn)主題。您需要做的就是將部分中主題的CSS文件替換為另一個可用主題,Stimlulsoft提供超過25個主題,您還可以根據(jù)需要調(diào)整CSS文件。例如,將Office2013 DarkGray Green 主題應(yīng)用于設(shè)計(jì)器:
<!-- Report designer Office2013 DarkGray Green style --> <link href="../css/stimulsoft.designer.office2013.darkgray.green.css" rel="stylesheet">
示例代碼的結(jié)果如下圖所示:
此示例顯示如何使用報(bào)表設(shè)計(jì)器事件,某些設(shè)計(jì)器操作包含訂閱的事件,例如,保存報(bào)表,創(chuàng)建新報(bào)表,預(yù)覽報(bào)表,退出設(shè)計(jì)器:
// Set the full screen mode for the designer var options = new Stimulsoft.Designer.StiDesignerOptions(); options.appearance.fullScreenMode = true; // Create the report designer with specified options var designer = new Stimulsoft.Designer.StiDesigner(options, "StiDesigner", false); // Assign the onSaveReport event function designer.onSaveReport = function (e) { var jsonStr = e.report.saveToJsonString(); alert("Save to JSON string complete.") } // Assign the onCreateReport event function designer.onCreateReport = function (e) { var ds = new Stimulsoft.System.Data.DataSet("Demo"); ds.readJsonFile("../reports/Demo.json"); e.report.regData("Demo", "Demo", ds); } // Assign the onPreviewReport event function designer.onPreviewReport = function (e) { switch (e.format) { case Stimulsoft.Report.StiExportFormat.Html: e.settings.zoom = 2; // Set HTML zoom factor to 200% break; } } // Assign the onExit event function designer.onExit = function (e) { } // Create a new report instance var report = new Stimulsoft.Report.StiReport(); // Load report from url report.loadFile("../reports/SimpleList.mrt"); // Edit report template in the designer designer.report = report; // Show the report designer in the 'content' element designer.renderHtml("content");
示例代碼的結(jié)果如下圖所示。
此示例顯示如何加載報(bào)表模板并在設(shè)計(jì)器中對其進(jìn)行編輯。您需要創(chuàng)建StiReport 類型的報(bào)表對象 ,然后通過調(diào)用loadFile() 方法加載報(bào)表模板文件 。要在設(shè)計(jì)器中編輯報(bào)表,只需將報(bào)表對象分配給設(shè)計(jì)器的報(bào)表屬性即可:
// Set the full screen mode for the designer var options = new Stimulsoft.Designer.StiDesignerOptions(); options.appearance.fullScreenMode = true; // Create the report designer with specified options var designer = new Stimulsoft.Designer.StiDesigner(options, "StiDesigner", false); // Create a new report instance var report = new Stimulsoft.Report.StiReport(); // Load report from url report.loadFile("../reports/SimpleList.mrt"); // Edit report template in the designer designer.report = report;
示例代碼的結(jié)果如下圖所示。
此示例顯示如何在默認(rèn)情況下以全屏模式顯示報(bào)表設(shè)計(jì)器。在全屏模式下,設(shè)計(jì)器將顯示在瀏覽器窗口的所有可用區(qū)域中。要在默認(rèn)情況下啟用此模式,您需要在StiDesignerOptions對象中設(shè)置fullScreenMode選項(xiàng) :
// Set full screen mode for the designer var options = new Stimulsoft.Designer.StiDesignerOptions(); options.appearance.fullScreenMode = true; // Create the report designer with specified options var designer = new Stimulsoft.Designer.StiDesigner(options, "StiDesigner", false);
示例代碼的結(jié)果如下圖所示。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn