Get SVG text from database and show as Image

240 views
Skip to first unread message

White Sorrow

unread,
Jun 12, 2018, 3:00:54 AM6/12/18
to myfyireporting
Hi , I have stored the svg text to the database and need to show as Image(have method to convert to bitmap or base64) on preview page by automatic determine is this field is xml text or not

which parts of source code that get data from db and show to the preview? 
and if I show text as Image on preview is there can export and can see the image on export file?

or maybe the another way to show svg text as Image automatically no not do anything with RDL file?

Thanks

Ганьков Андрей

unread,
Jun 13, 2018, 2:05:44 AM6/13/18
to myfyire...@googlegroups.com
As far as I know, RDL specification didn't support SVG. I think we didn't support it too.
But you can implement support svg as image type in any case.

About export image. This is absolutely depends on render used for export. For example, current render for Excel didn't support export any image.

White Sorrow

unread,
Jun 13, 2018, 2:20:08 AM6/13/18
to myfyireporting
I had add the class for convert SVG text to image already , but what I need is how could I change the preview process that I can check if VALUE from database is xml text and I can choose to show value as Image

example:

field name in db is image
for normally table value is =Fields!image.Value 
and when I go to preview tab this cell query value from database then check before render the page

if(xml type?){
   convert context to image as base64 or bitmap
}else{
   show normal text
}

Thanks

เมื่อ วันพุธที่ 13 มิถุนายน ค.ศ. 2018 13 นาฬิกา 05 นาที 44 วินาที UTC+7, Andrey Gankov เขียนว่า:

Ганьков Андрей

unread,
Jun 13, 2018, 2:51:15 AM6/13/18
to myfyire...@googlegroups.com
Perhaps, I didn't understand you question or i didn't understand what you do.
I think Majorsilence Reporting will not automatically detect that field is svg or is not. I think user need say that this is svg, like user did it for jpeg and another image types.

If you say about table, you need replace cell from text to image.
See https://ibb.co/eETE4d
and https://ibb.co/btxSqJ
--
You received this message because you are subscribed to the Google Groups "myfyireporting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to myfyireportin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Подписывайтесь на наши новости в ВконтактеGoogle+ Ok Twitter YouTube

Ганьков Андрей
Quality Solution
офис: +7-812-309-80-89
мобильный: +7-911-914-01-91(Telegram, Viber)
E-mail: g...@qsolution.ru

White Sorrow

unread,
Jun 13, 2018, 7:50:34 AM6/13/18
to myfyireporting
This is what I need to do

I need to change some of source code of ReportDesigner when ReportDesigner have a table or anything else that need to query the value from database

In this query when ReportDesigner get data from the database I can add my source code to decide is it xml or not(this I have method to do)

But the problem is I don't know which cs file,method that do this process , So I can't add my source code to it.

or maybe cs file/method that render the ReportPreviewPage so I can force it to show image instead of text

Thanks for reply

White Sorrow

unread,
Jun 14, 2018, 12:11:43 AM6/14/18
to myfyireporting
I have solved this

This is what I do:

at the RdlEngine project in the definition/Image.cs at GetImageStream method I have check if the value is xml string then convert to svg -> draw to bitmap -> convert to byte[] then use normally.

this will convert the xml string to image byte and show at preview page

** User need to replace textbox with image by manual (can be automatic replace by check column name,but it will exclusive for specify project only)

Thanks
Reply all
Reply to author
Forward
0 new messages