Search

RS.EXE fails to deploy a report upgraded from SQL Server 2005 Reporting Services - "report definition is not valid" by Stacia Misner

Closed
as By Design Help for as By Design

6
0
Sign in
to vote
Type: Bug
ID: 331311
Opened: 3/3/2008 9:47:12 PM
Access Restriction: Public
1
Workaround(s)
8
User(s) can reproduce this bug
I upgraded a SQL Server 2005 report to SQL Server 2008 using Business Intelligence Development Studio. The report deploys successfully from BIDS to Report Manager and can be viewed. An attempt to deploy the same report using rs.exe results in an error.
Details (expand)
Product Language
English

Version

SQL Server 2008 February CTP

Category

Reporting Services

Operating System

Win2003 Enterprise Server (SP2)
Operating System Language
US English
Steps to Reproduce
1. Open a SQL Server 2005 report project and allow the reports in the project to be upgraded.
2. Deploy the report from BIDs to confirm successful deployment.
3. Create an RSS script to deploy the report to the report server using a different target folder from the target specified in BIDS.
3. Execute the script.
Actual Results
Error:

System.Web.Services.Protocols.SoapException: The report definition is not valid.

Details: '.', hexadecimal value 0x00, is an invalid character. Line 948, position 10.

at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.CreateReport(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, Warning[]& Warnings)

at Microsoft.ReportingServices.WebServer.ReportingService2005.CreateReport(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, Warning[]& Warnings)

Expected Results
Successful execution of the script with no error.

Platform

32
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 3/7/2008 at 11:17 AM
Thank you for filing this bug.

Thank you for filing this bug.

In prior occurances of this issue we have found the root cause to be in the definition of the byte array in the *.rss file:

Replacing
My_Byte_Array = New [Byte](stream.Length) {}
With
My_Byte_Array = New [Byte](stream.Length - 1) {}

seems to solve this issue.


Because we use VBCodeProvider to Create Script Assembly from *.rss file. It means your *.rss file is compiled with VB.NET syntax. According to VB.NET language specification (http://msdn2.microsoft.com/en-us/library/aa712038(VS.71).aspx) when we use following expression:

definition = New [Byte](N) {}

We create an array of (N+1) elements with bounds [0 .. N]

Hence, "My_Byte_Array" is created 1 byte longer than file size is. It is initialized with 0x00 by default.After that we read file to "My_Byte_Array" array. We fill all elements but not the last one that is still 0x00.
It causes error:
"Error : rsProcessingError (The report definition is not valid. Details: '.', hexadecimal value 0x00, is an invalid character. Line 948, position 10.)"

HTH
Prash
Sign in to post a workaround.
Posted by Azm0dAn on 4/5/2010 at 1:14 PM
We use a simple workaround for this problem.

Our original code is:

[...]
Try
    Dim stream As FileStream = File.OpenRead(reportFile.FullName)
    definition = New [Byte](stream.Length) {}
    stream.Read(definition, 0, CInt(stream.Length))
    stream.Close()
Catch e As IOException
        Console.WriteLine(reportFile.FullName + " - " + e.Message)
End Try

Try
    warnings = rs.CreateReport(reportName, parentPath, overwrite, definition, Nothing)

[...]

When the RS throws an exception in that last line we verify if the exception message contains the following string: "hexadecimal value 0x00". If it does we call the same method but with just a small difference:

    Dim stream As FileStream = File.OpenRead(reportFile.FullName)
    definition = New [Byte](stream.Length-1) {} 'By creating a smaller Byte[] you go around the problem....
    stream.Read(definition, 0, CInt(stream.Length))

Hope it helps.