Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
825 views
in Technique[技术] by (71.8m points)

sql server - The report definition has an invalid target namespace rsInvalidReportDefinition

I have created a ReportProject with Visual Studio data tools 2015. When I create a report.rdl file using the report wizard, the rdl file has schema for 2016. My reporting server is of version 12.0.4213.0.

How can I create a report.rdl which is compatible with my reporting server. I tried changing the TargetServerVersion by right clicking the project -> properties and changing the targetserverversion to "Sql server 2008 R2, 2012 or 2014". But this doesn't work either.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Edit: The specific version of the report you set as the TargetServerVersion property gets created in the BIN (debug or wherever you build to) folder as long as you are not using any 2016 features.

I'm trying to find the same answer. You would think simply setting the solution's TargetServerVersion the way you did would cause it to use the right report definition (or optionally they could give you the option to add a pre-2016 report item)

Until then, if you right click the .rdl and "view code", you can change the following lines to make it work in SQL 2014 - just make a backup of your original .rdl in case you make a mistake:

1) Replace the report xmlns line with the following:

<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">

2) Remove the ReportSections and ReportSection lines, keeping the child tree structure body tag etc. below it). So remove these:

  <ReportSections>
    <ReportSection>

and these...

    </ReportSection>
  </ReportSections>

3) Remove the entire ReportParametersLayout section. So (e.g.) remove this:

  <ReportParametersLayout>
    <GridLayoutDefinition>
      <NumberOfColumns>4</NumberOfColumns>
      <NumberOfRows>2</NumberOfRows>
    </GridLayoutDefinition>
  </ReportParametersLayout>

Hit save, go back into the design and run the report. If you haven't modified the design it will work in SQL2014. The minute you change any fields it will revert to the 2016 schema.

If anyone sees a way to fix this behavior let us know. Thanks!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...