Location of configuration file used by Report Wizard Query Builder to source default values for report formatting

我只是一个虾纸丫 提交于 2021-01-29 02:27:43

问题


When I use the Report Wizard Query Builder to create a report the report is created with a selection of default values. These default values are revealed by right clicking on the Report.RDL file in Solution Explorer and opening it with the XML (Text) Editor.

Examples of the default values that are applied by the Report Wizard when creating the Report.RDL file are:

Example <df:DefaultFontFamily>Segoe UI</df:DefaultFontFamily>
Example <Color>#666666</Color>
Example <BottomBorder>
          <Style>Solid</Style>
        </BottomBorder>

I know I can edit these values using the GUI or directly editing the XML file.

What I want to do is edit the configuration file that the Wizard is using to source these defaults so that my custom defaults are automatically applied when new reports are created.

I have looked in the MSDN doco and my SQL/SSRS/VS directories for this configuration file but cannot find it.

Following Alan's suggestion I have opened the Report.rdl file at: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\SSRS\ProjectItems\ReportProject.

The contents of the file are:

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:df="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition/defaultfontfamily" MustUnderstand="df">
  <df:DefaultFontFamily>Segoe UI</df:DefaultFontFamily>
  <ReportSections>
    <ReportSection>
      <Body>
        <Height>2in</Height>
      </Body>
      <Width>6.5in</Width>
      <Page>
      </Page>
    </ReportSection>
  </ReportSections>
  <rd:ReportTemplate>true</rd:ReportTemplate>
</Report>

I've tried changing the <df:DefaultFontFamily> but the change is not reflected in subsequent reports that I generate. Also, I still don't understand where default <Color> and <BottomBorder> default values are being set as they are not referenced in Report.rdl.

Can anyone please tell me how I should best modify Report.rdl to change the defaults used. Can I just add arbitrary XML to it? Alternatively, if Report.rdl is not the source file for default values can anyone tell me where I can find the default source file so that, if possible, I can edit it.


回答1:


Are you using Visual Studio?

If so, you can find the defalut RDL here..

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\SSRS\ProjectItems\ReportProject

Open and edit the Report.Rdl file in this folder.

Replace the 2019 and Professional with the version you are using.

Personally, I really don't like using the wizard, it's often means more work fixing the default report scheme and layout and it's much faster, certainly after a a little practice, you build the report from scratch.

The other advantage is that you can create a template with your default page size, orientation, headers/footer and fonts etc. Then when you create a new report, you can select this from the list of templates. If you create reports frequently, I promise you will find it faster in the long run.



来源:https://stackoverflow.com/questions/60827012/location-of-configuration-file-used-by-report-wizard-query-builder-to-source-def

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!