发布时间 : 2015-12-25 11:01:24.000|阅读 1591 次
概述:本片文章主要介绍Stimulsoft Reports.Net开发者在配置报表时遇到的常见问题及解决方案。
相关链接:
< 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属性被修改后,报表生成器会自动将所有尺寸和组件位置转换为新的单位。
购买最新正版授权!"咨询在线客服"
慧都年终盛典火爆开启,一年仅一次的最强促销,破冰钜惠不容错过!!优惠详情点击查看>>