I'm working on SSRS
Report.
I have the content with Data type Image
. I want to convert it into plain-text
or XML
. Is it possible?
I am not providing the sample data as there is huge data. (Whole report content saving to image so we can understand)
Suggest me the best solution.
Tried below and working fine but appending extra string like this 
to output.
Used RIGHT() to chop off first 3 characters - working fine
SELECT
RIGHT(CONVERT(VARCHAR(MAX),CONVERT(VARCHAR(MAX),CONVERT(VARBINARY(MAX) ,ImageDataField))),
LEN(CONVERT(VARCHAR(MAX),CONVERT(VARCHAR(MAX),CONVERT(VARBINARY(MAX) ,ImageDataField))))-3)
This works from SQL Server Management Studio, when the current database is the ReportServer database.
-- given a NonRemitted_detail.rdl file that was deployed to a report server on path /Jacket Generator
-- the contents can be found as XML with this:
SELECT CONVERT(XML, CONVERT(VARBINARY(MAX), Content)) AS rdl_file_content
FROM ReportServer.dbo.[Catalog]
WHERE [Path] = N'/Jacket Generator/NonRemitted_detail'
Nearly identical. Whitespace between XML elements has been stripped. The opening XML declaration is missing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With