March 23, 2021 at 8:42 pm
Hi
I have a table with a signature embedded in an XML field.
I wanted to write a SSRS report to display the signature. Does anyone know where I can look for how to/if I can display the signature?
Thanks
March 23, 2021 at 8:48 pm
Pretty sure you are going to be looking at parsing the XML to get the signature. You can do this with TSQL (which is where i would start). Once you have the TSQL for that working, then it is just a matter of adding that into the SSRS report as a data set.
I imagine you could also put the RAW XML into the SSRS report, but that probably isn't what you are wanting to do, right?
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
March 23, 2021 at 11:44 pm
I'm sorry...
I was way off it's an nvarchar(MAX) field. I put a sample below of what the field contains.
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="129" height="45"><path fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M 1 1 c 0.45 0.05 17.68 1.53 26 3 c 2.72 0.48 5.37 2.7 8 3 c 5.54 0.64 18 0 18 0"/><path fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M 28 7 l 0 37"/><path fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M 44 26 c 0.33 0 12.87 0.27 19 0 c 1.33 -0.06 3.93 -0.32 4 -1 c 0.16 -1.57 -1.66 -6.9 -3 -9 c -0.63 -0.99 -2.68 -1.81 -4 -2 c -2.95 -0.42 -7.05 -0.42 -10 0 c -1.32 0.19 -3.27 1.13 -4 2 c -0.67 0.8 -0.91 2.67 -1 4 c -0.23 3.22 -0.67 7.16 0 10 c 0.54 2.29 2.52 5.1 4 7 c 0.66 0.85 1.96 1.78 3 2 c 3.18 0.68 7.25 0.84 11 1 c 4.07 0.18 8.62 0.45 12 0 l 3 -2"/><path fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M 108 14 c -0.04 -0.05 -1.15 -2.34 -2 -3 c -1.9 -1.48 -4.61 -3.16 -7 -4 c -3.02 -1.07 -6.89 -1.79 -10 -2 c -1.56 -0.1 -3.84 0.34 -5 1 c -0.82 0.47 -1.92 2.02 -2 3 c -0.2 2.46 0.22 6.85 1 9 c 0.31 0.86 2 1.75 3 2 c 1.38 0.34 3.39 -0.23 5 0 c 2.97 0.42 6.3 1.1 9 2 c 1.06 0.35 2.46 1.2 3 2 c 0.61 0.92 1 2.72 1 4 c 0 3.13 -0.33 7.11 -1 10 c -0.24 1.04 -1.18 2.53 -2 3 c -1.16 0.66 -3.47 1 -5 1 c -1.24 0 -3.17 -0.27 -4 -1 l -4 -6"/><path fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M 120 2 c -0.02 0.09 -0.95 3.33 -1 5 c -0.28 9.51 -0.52 20.36 0 29 c 0.08 1.33 1.04 3.25 2 4 c 1.63 1.27 7 3 7 3"/><path fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M 113 18 l 11 -2"/></svg>
March 24, 2021 at 2:46 pm
Maybe I'm a bit unfamiliar with that level of XML, but to me that looks like it is XML that is expected to be read by a specific tool (svg?).
From looking at that, I am expecting that SVG is a vector graphic format. So even though it stores its data as XML, you would need an SVG parser to handle the conversion of that into another format.
Quick google on it, found this article which may (or may not) help, but did confirm my suspicion that SVG is a vector graphics format:
Basically, SSRS doesn't handle SVG format. I mean, you MIGHT be able to do some fancy stuff using Python in SQL Server and have that presented in SSRS but I know that is something I've never tried and I wouldn't even know where to start.
Alternately, if you have a tool that can read the SVG format and export it as an image, you could store the image in a VARBINARY column in SQL Server and then use the VARBINARY column to display an image in SSRS - https://www.kodyaz.com/articles/display-database-image-using-sql-server-2008-reporting-services.aspx
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
March 24, 2021 at 8:59 pm
Thank you...
Let me do a bit of reading, see if I can come up with something, maybe export to python or something....
March 24, 2021 at 10:04 pm
I am just thinking if you have Python in SQL Server (can't remember if 2012 had that or not, but thinking it MAY have been a newer version that first came with Python support baked in), that you may be able to use python to build the SVN and send that off to SSRS.
Otherwise you are going to need some tool to migrate the SVG data into something that can be consumed by SSRS. It MAY be easiest to use whatever tool generated the SVG file to parse it and put it into an image format to be consumed by SSRS.
Alternately, SSRS may be the wrong target tool for this job. What I mean is it MAY make more sense to export the SVG data and store it in multiple SVG files on disk and let an SVG reader handle rendering the data. It may be that you find a way to make it work in SSRS as it is right now, but in the future, someone may put some SVG data in there in a newer SVG format and it may break. Or someone may put bad SVG data in there and things break.
Just my 2 cents...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply