Resolve SSRS Issue There is an error in XML document (1, 2385915). ' ', hexadecimal value 0x1A, is an invalid character. Line 1, position 2385915.

Faced the below issue after deploying the SSRS report in SSRS server. I don't see any issue with data tools on my desktop version but once I deploy it the report breaks. Below is the error message:

When we follow the error message it is definitely misleading and I concentrated mostly on the connections at report server level but finally I focused again on the error message which made me to see closely towards the parameters.
I analysed and took a look at the employee name parameter and understood that this is the key point where the issue is. Based on the description in the error message I wrote a below query and got the below records leading to the error.

Select distinct CHARINDEX(cast(0x1A as varchar(1)),Col1),Col2,Col1
from 
dbo.Table
Where 
CHARINDEX(cast(0x1A as varchar(1)),Col1) > 0

The above query will give the records which has junk or dirty data in the column values. As per the error message I tested the data in Col1 with value "0*1A" in it. So after retrieving the records I replaced the junk values in name data with "" value. But before replacing we need to find out the ASCII value. For Ex:

SELECT ASCII(' ')

Which will give you the below value


Now you need to plan to replace this character with nothing as below

Once I replaced the data in the report server itself and published it that resolved the issue.

No comments:

Post a Comment