我知道我正在复活一个很长的死线程,但对于那些想要在VS2010中做到这一点的人来说,RDL文件位于稍微不同的位置。
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject\Report.rdl
我在英国,所以觉得非常恼人必须不断地从英寸转换到厘米和“EN-US”到“EN-GB”。我有时会忘记,然后才会意识到,当我的日期栏显示这是31个月的第7天时。为什么在VS中没有可用的选项来表示'en-GB'是我的默认语言环境,'cm'是我的默认测量单位,这完全超出了我的想象。微软提供了所有主流语言的软件,支持多种日历类型,但是他们之所以这么做,是因为他们认为所有使用VS的开发人员都是基于美国的... </rant>
我修改了我的Report.rdl文件如下解决这个问题,但如前所述,只有当我不使用向导。至今我还没有找到任何在向导中设置默认值的方法。在Report.rdl旁边的文件夹中有一个名为ReportWizard.wsz的文件,但它看起来只包含指向各种对象的指针。我们可以使用某些东西,但我不会屏住呼吸。
我写的报告有95%的页面属性为A4风景,边长为0.5cm,没有互动尺寸,还有一个标题顶部的文本框,所以我也扔了。这是整个Report.rdl文件,如果你想复制它或修改它适合。
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<Body>
<ReportItems>
<Textbox Name="TextBoxReportTitle">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Report Title</Value>
<Style>
<FontSize>20pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>SteelBlue</Color>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox1</rd:DefaultName>
<Height>0.9cm</Height>
<Width>28.7cm</Width>
<DataElementOutput>NoOutput</DataElementOutput>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Height>5cm</Height>
<Style />
</Body>
<Width>28.7cm</Width>
<Page>
<PageHeight>29.7cm</PageHeight>
<PageWidth>21cm</PageWidth>
<InteractiveHeight>0cm</InteractiveHeight>
<InteractiveWidth>0cm</InteractiveWidth>
<LeftMargin>0.5cm</LeftMargin>
<RightMargin>0.5cm</RightMargin>
<TopMargin>0.5cm</TopMargin>
<BottomMargin>0.5cm</BottomMargin>
<ColumnSpacing>0.13cm</ColumnSpacing>
<Style />
</Page>
<AutoRefresh>0</AutoRefresh>
<Language>en-GB</Language>
<rd:ReportUnitType>Cm</rd:ReportUnitType>
</Report>
如果您有许多定期使用的默认报告设计,那么制作新模板非常容易。只需制作一份快速报告,其中包含所需的基本外观以及设置的所有设置,然后将rdl的副本保存到上面的文件夹中,因为此标记是自动生成的,所以我移除了<rd:ReportID>
标记。现在,如果你去添加一个新项目到你的项目中,你的新模板将出现在VS的列表中。
您也可以对像素使用' Point rd:ReportUnitType>' –
2010-04-29 02:48:13