Four Js Development Tools Forum

Discussions by product => Reporting tools (GRW, GRE) => Topic started by: France P. on March 17, 2017, 10:26:46 am



Title: How to generate simple SVG graphics strings for use in GRW imagebox drawable
Post by: France P. on March 17, 2017, 10:26:46 am
Hi, I have seen some tools for drawing/importing/converting simple business graphics in SVG format, but not sure what the approach should be.
Can you recommend an easy method of producing a simple graphic and lifting the entire SVG result (URL encoded I think?) and placing in the Imagebox location field for printing, similar to the examples in the Genero Report from Templates, without having to do any kind of edits first?

below from Genero DIN 5008 template:

data:image/svg,%3C?xml version=%221.0%22 encoding=%22UTF-8%22?%3E%0A%3Csvg width=%22375pt%22 height=%22119pt%22 version=%221.2%22 xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1562 494%22%3E%0A    %3Cpath d=%22M 0 0 V 494 L 428 248 z L 631 277 L 1208 0 z%22 fill=%22#42A62A%22 stroke=%22%2342A62A%22/%3E%0A    %3Cpath d=%22M 0 0 L 428 247 L 486 214 z M 631 277 L 1208 0 H 1562 z%22 fill=%22%2300632D%22 stroke=%22%2300632D%22/%3E%0A%3C/svg%3E%0A

Thanks


Title: Re: How to generate simple SVG graphics strings for use in GRW imagebox drawable
Post by: Alex G. on March 21, 2017, 10:03:19 am
Hi,
sorry for the late reply (we are currently releasing).
How images can be embedded and encoded is explained in the documentation here: http://4js.com/online_documentation/fjs-gst-manual-html/#c_grd_layoutelements_imagebox.html
Options are that the images can be referenced as files where the files names can be static or constructed dynamically at runtime from variable values by means of RTL expresssions. If the images are stored in variables (possibly BLOBS) then it is also possible to use the variable value directly (maybe requiring a call to an RTL encoding function). All these options are explained in the documentation.
I am not sure that I completely understood the requirement. Is it that you have some sort of software that creates business charts from run time data and the output format of that program is SVG?
If yes, then you could have that program create a SVG file and in the report design you refer to that image from an IMAGEBOX.
Or is it perhaps that you are planning to call a HTTP based service like Google charts. In that case you can use the URL directly from the IMAGEBOX location property possibly requiring the calling of a RTL encoding function on the result as described in the documentation.
Kind regards,
Alex