原創|使用教程|編輯:鄭恭琳|2015-12-25 11:01:24.000|閱讀 1674 次
概述:本片文章主要介紹Stimulsoft Reports.Net開發者在配置報表時遇到的常見問題及解決方案。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
< Stimulsoft Reports.Net v2015.3最新版本下載>
使用StiConfig類的Save和Load方法。
將靜態屬性StiOptions.Configuration.DontSaveConfig設置為true。
移除Stimulsoft.Report.config文件并返回到應用程序。當再次創建Stimulsoft Reports配置文件時,你會調用StiConfig.Restore方法。該方法將會默認恢復配置。
你應該關閉配置的自動保存,然后在適當的時間適當的地方加載和保存配置。
使用StiConfig類的Saving和Loading事件。寫處理程序并將它們連接到這些事件中。
方法如下:
<system.diagnostics> <switches> <add name="traceLevel" value="4" /> </switches> <trace autoflush="true" indentsize="4"> <listeners> <add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\Inetpub\wwwroot\ambReports1\_trace.log" /> <remove type="System.Diagnostics.DefaultTraceListener"/> </listeners> </trace> </system.diagnostics>
將靜態屬性StiOptions.Engine.HideExceptions設置為false。
使用如下代碼:
C#
//Specify the file of localization StiConfig.LoadLocalization("MyLocalization.xml");
VB
'Specify the file of localization StiConfig.LoadLocalization("MyLocalization.xml")
將靜態屬性StiOptions.Engine.HideMessages設置為true。
Stimulsoft Reports中搜索本地資源的目錄是在靜態屬性StiOptions.Configuration.DirectoryLocalization中進行設置的。該屬性默認值為"Localization",若有必要你也可以對該屬性值進行修改。
在應用程序放置的目錄里創建Localization目錄。復制包含本地資源的xml文件。當運行第一個Stimulsoft Reports時將會找到該目錄,以及所有文件的本地資源。
使用以下代碼減少關系的最大層次:
StiOptions.Dictionary.BusinessObjects.MaxLevel = 2;//By default 10
使用以下代碼實現從右到左的預覽模式:
StiOptions.Window.RightToLeft = StiRightToLeftType.Yes;
報表組件的坐標被存儲時在厘米、毫米、英寸和百分之一英寸中。對話框的所有坐標存儲在像素中。
使用StiReport類的Unit屬性,具體方法如下:
C#
//Set centimeters Report.Unit = new StiCentimetersUnit(); //Set millimeters Report.Unit = new StiMillimetersUnit(); //Set inches Report.Unit = new StiInchesUnit(); //Set hundredths of inch Report.Unit = new StiHundredthsOfInchUnit();
VB
'Set centimeters Report.Unit = New StiCentimetersUnit() 'Set millimeters Report.Unit = New StiMillimetersUnit() 'Set inches Report.Unit = New StiInchesUnit() 'Set hundredths of inch Report.Unit = New StiHundredthsOfInchUnit()
在Unit屬性被修改后,報表生成器會自動將所有尺寸和組件位置轉換為新的單位。
購買最新正版授權!""
慧都年終盛典火爆開啟,一年僅一次的最強促銷,破冰鉅惠不容錯過!!優惠詳情點擊查看>>
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn