Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Dynamic SVG Image: Item is not supported
Dynamic SVG Image: Item is not supported [message #720979] Wed, 31 August 2011 11:54 Go to next message
Eclipse User
Originally posted by: Mirko Swillus

Hej,

I'm trying to render a SVG image that is provided as a byte array within
a DataSource, target format is PDF. All the PDF says, is

"Current report item is not supported in this report format."

When I put a JPG as a byte array into the DataSources property
'row["Image"]' (see rptdesign below) everything works fine. Furthermore,
adding an embedded SVG image works, too.

I guess I have to specify the images mime type ("image/svg+xml"), image
type or file extension, but I have no glue how to do it. All I tried
concerning this failed.

Please find the interesting part of my .rptdesign below. Thanks in advance,

Mirko Swillus

===========================================
<body>
<image name="name_blue" id="15">
<property name="height">3.15625in</property>
<property name="width">7.583333333333333in</property>
<property name="dataSet">Data Set</property>

<list-property name="boundDataColumns">
<structure>
<property name="name">Image</property>
<expression name="expression"
type="javascript">dataSetRow["Image"]</expression>
<property name="dataType">javaObject</property>
</structure>
</list-property>
<structure name="toc"/>
<property name="source">expr</property>
<expression name="valueExpr">row["Image"]</expression>
</image>
</body>
============================================
Re: Dynamic SVG Image: Item is not supported [message #721115 is a reply to message #720979] Wed, 31 August 2011 18:28 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Have you set the data type to blob and tried it?

I was able to read one from a file in the image onCreate script like:
importPackage(Packages.java.io);
importPackage(Packages.java.lang);



var file = new File("C:/work/workspaces/2.6.1workspaces/BIRT -
Reports/BIRT Reports/resources/spain.svg");
var ist = new FileInputStream(file);
var lengthi = file.length();

bytesa = new ByteArrayOutputStream( lengthi);
var c;
while((c=ist.read()) != -1){
bytesa.write(c);
} ist.close();

this.data = bytesa.toByteArray();


Jason

On 8/31/2011 11:54 AM, Mirko Swillus wrote:
> Hej,
>
> I'm trying to render a SVG image that is provided as a byte array within
> a DataSource, target format is PDF. All the PDF says, is
>
> "Current report item is not supported in this report format."
>
> When I put a JPG as a byte array into the DataSources property
> 'row["Image"]' (see rptdesign below) everything works fine. Furthermore,
> adding an embedded SVG image works, too.
>
> I guess I have to specify the images mime type ("image/svg+xml"), image
> type or file extension, but I have no glue how to do it. All I tried
> concerning this failed.
>
> Please find the interesting part of my .rptdesign below. Thanks in advance,
>
> Mirko Swillus
>
> ===========================================
> <body>
> <image name="name_blue" id="15">
> <property name="height">3.15625in</property>
> <property name="width">7.583333333333333in</property>
> <property name="dataSet">Data Set</property>
>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">Image</property>
> <expression name="expression"
> type="javascript">dataSetRow["Image"]</expression>
> <property name="dataType">javaObject</property>
> </structure>
> </list-property>
> <structure name="toc"/>
> <property name="source">expr</property>
> <expression name="valueExpr">row["Image"]</expression>
> </image>
> </body>
> ============================================
>
>
>
>


Jason Weathersby

BIRT Exchange
Re: Dynamic SVG Image: Item is not supported [message #721269 is a reply to message #721115] Thu, 01 September 2011 05:50 Go to previous messageGo to next message
Eclipse User
Originally posted by: Mirko Swillus

Jason,
Am 01.09.2011 00:28, schrieb Jason Weathersby:
> Have you set the data type to blob and tried it?

thanks for your answer, but changing 'javaObject' to 'blob' makes no
difference.

But I managed to solve the problem, with the help of [0]. As I guessed
yesterday, I had to set the MIME type explicitly, since BIRT obviously
has problems to resolve the image type itself when overhanding a SVG as
a byte array (at least within my BIRT 3.7 runtime here, providing a JPG
the same way works fine).

The resulting part of my .rptdesign looks like this now:

==========================================
<body>
<image name="some" id="15">
<property name="height">3.15625in</property>
<property name="width">7.583333333333333in</property>
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">Image</property>
<expression name="expression"
type="javascript">dataSetRow["Image"]</expression>
<property name="dataType">javaObject</property>
</structure>
</list-property>
<structure name="toc"/>
<property name="source">expr</property>
<expression name="valueExpr">row["Image"]</expression>
<expression name="typeExpr">"image/svg+xml"</expression>
</image>
</body>
===========================================

Mind the <expression name="typeExpr">"image/svg+xml"</expression>.
Quotes are required because it has to be a valid JavaScript Expression.

Regards,
Mirko Swillus


[0]
http://www.eclipse.org/birt/ref/rom/elements/Image.html#Property-typeExpr

Am 01.09.2011 00:28, schrieb Jason Weathersby:
> Have you set the data type to blob and tried it?
>
> I was able to read one from a file in the image onCreate script like:
> importPackage(Packages.java.io);
> importPackage(Packages.java.lang);
>
>
>
> var file = new File("C:/work/workspaces/2.6.1workspaces/BIRT -
> Reports/BIRT Reports/resources/spain.svg");
> var ist = new FileInputStream(file);
> var lengthi = file.length();
>
> bytesa = new ByteArrayOutputStream( lengthi);
> var c;
> while((c=ist.read()) != -1){
> bytesa.write(c);
> } ist.close();
>
> this.data = bytesa.toByteArray();
>
>
> Jason
>
> On 8/31/2011 11:54 AM, Mirko Swillus wrote:
>> Hej,
>>
>> I'm trying to render a SVG image that is provided as a byte array within
>> a DataSource, target format is PDF. All the PDF says, is
>>
>> "Current report item is not supported in this report format."
>>
>> When I put a JPG as a byte array into the DataSources property
>> 'row["Image"]' (see rptdesign below) everything works fine. Furthermore,
>> adding an embedded SVG image works, too.
>>
>> I guess I have to specify the images mime type ("image/svg+xml"), image
>> type or file extension, but I have no glue how to do it. All I tried
>> concerning this failed.
>>
>> Please find the interesting part of my .rptdesign below. Thanks in
>> advance,
>>
>> Mirko Swillus
>>
>> ===========================================
>> <body>
>> <image name="name_blue" id="15">
>> <property name="height">3.15625in</property>
>> <property name="width">7.583333333333333in</property>
>> <property name="dataSet">Data Set</property>
>>
>> <list-property name="boundDataColumns">
>> <structure>
>> <property name="name">Image</property>
>> <expression name="expression"
>> type="javascript">dataSetRow["Image"]</expression>
>> <property name="dataType">javaObject</property>
>> </structure>
>> </list-property>
>> <structure name="toc"/>
>> <property name="source">expr</property>
>> <expression name="valueExpr">row["Image"]</expression>
>> </image>
>> </body>
>> ============================================
>>
>>
>>
>>
>
Re: Dynamic SVG Image: Item is not supported [message #721387 is a reply to message #721269] Thu, 01 September 2011 12:01 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Thanks for posting.

Jason

On 9/1/2011 5:50 AM, Mirko Swillus wrote:
> Jason,
> Am 01.09.2011 00:28, schrieb Jason Weathersby:
> > Have you set the data type to blob and tried it?
>
> thanks for your answer, but changing 'javaObject' to 'blob' makes no
> difference.
>
> But I managed to solve the problem, with the help of [0]. As I guessed
> yesterday, I had to set the MIME type explicitly, since BIRT obviously
> has problems to resolve the image type itself when overhanding a SVG as
> a byte array (at least within my BIRT 3.7 runtime here, providing a JPG
> the same way works fine).
>
> The resulting part of my .rptdesign looks like this now:
>
> ==========================================
> <body>
> <image name="some" id="15">
> <property name="height">3.15625in</property>
> <property name="width">7.583333333333333in</property>
> <property name="dataSet">Data Set</property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">Image</property>
> <expression name="expression"
> type="javascript">dataSetRow["Image"]</expression>
> <property name="dataType">javaObject</property>
> </structure>
> </list-property>
> <structure name="toc"/>
> <property name="source">expr</property>
> <expression name="valueExpr">row["Image"]</expression>
> <expression name="typeExpr">"image/svg+xml"</expression>
> </image>
> </body>
> ===========================================
>
> Mind the <expression name="typeExpr">"image/svg+xml"</expression>.
> Quotes are required because it has to be a valid JavaScript Expression.
>
> Regards,
> Mirko Swillus
>
>
> [0]
> http://www.eclipse.org/birt/ref/rom/elements/Image.html#Property-typeExpr
>
> Am 01.09.2011 00:28, schrieb Jason Weathersby:
> > Have you set the data type to blob and tried it?
> >
> > I was able to read one from a file in the image onCreate script like:
> > importPackage(Packages.java.io);
> > importPackage(Packages.java.lang);
> >
> >
> >
> > var file = new File("C:/work/workspaces/2.6.1workspaces/BIRT -
> > Reports/BIRT Reports/resources/spain.svg");
> > var ist = new FileInputStream(file);
> > var lengthi = file.length();
> >
> > bytesa = new ByteArrayOutputStream( lengthi);
> > var c;
> > while((c=ist.read()) != -1){
> > bytesa.write(c);
> > } ist.close();
> >
> > this.data = bytesa.toByteArray();
> >
> >
> > Jason
> >
> > On 8/31/2011 11:54 AM, Mirko Swillus wrote:
> >> Hej,
> >>
> >> I'm trying to render a SVG image that is provided as a byte array
> within
> >> a DataSource, target format is PDF. All the PDF says, is
> >>
> >> "Current report item is not supported in this report format."
> >>
> >> When I put a JPG as a byte array into the DataSources property
> >> 'row["Image"]' (see rptdesign below) everything works fine.
> Furthermore,
> >> adding an embedded SVG image works, too.
> >>
> >> I guess I have to specify the images mime type ("image/svg+xml"), image
> >> type or file extension, but I have no glue how to do it. All I tried
> >> concerning this failed.
> >>
> >> Please find the interesting part of my .rptdesign below. Thanks in
> >> advance,
> >>
> >> Mirko Swillus
> >>
> >> ===========================================
> >> <body>
> >> <image name="name_blue" id="15">
> >> <property name="height">3.15625in</property>
> >> <property name="width">7.583333333333333in</property>
> >> <property name="dataSet">Data Set</property>
> >>
> >> <list-property name="boundDataColumns">
> >> <structure>
> >> <property name="name">Image</property>
> >> <expression name="expression"
> >> type="javascript">dataSetRow["Image"]</expression>
> >> <property name="dataType">javaObject</property>
> >> </structure>
> >> </list-property>
> >> <structure name="toc"/>
> >> <property name="source">expr</property>
> >> <expression name="valueExpr">row["Image"]</expression>
> >> </image>
> >> </body>
> >> ============================================
> >>
> >>
> >>
> >>
> >
>


Jason Weathersby

BIRT Exchange
Re: Dynamic SVG Image: Item is not supported [message #777630 is a reply to message #721387] Tue, 10 January 2012 15:57 Go to previous messageGo to next message
Chris Harrington is currently offline Chris Harrington
Messages: 10
Registered: January 2012
Junior Member
I tried setting typeExpr to "image/svg+xml" but am not getting the SVG to display. Same code works for PNG, and SVG url works if is static. What might I check?
Re: Dynamic SVG Image: Item is not supported [message #778399 is a reply to message #777630] Wed, 11 January 2012 12:28 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

What browser are you using?

Jason

On 1/10/2012 3:57 PM, Chris Harrington wrote:
> I tried setting typeExpr to "image/svg+xml" but am not getting the SVG
> to display. Same code works for PNG, and SVG url works if is static.
> What might I check?


Jason Weathersby

BIRT Exchange
Re: Dynamic SVG Image: Item is not supported [message #778713 is a reply to message #778399] Fri, 13 January 2012 12:19 Go to previous messageGo to next message
Chris Harrington is currently offline Chris Harrington
Messages: 10
Registered: January 2012
Junior Member
Firefox 9
Re: Dynamic SVG Image: Item is not supported [message #778715 is a reply to message #778713] Fri, 13 January 2012 12:28 Go to previous messageGo to next message
Chris Harrington is currently offline Chris Harrington
Messages: 10
Registered: January 2012
Junior Member
I also tried doing it in onCreate()

First, I tried using it directly:

-- begin code --

importPackage(Packages.java.io);
importPackage(Packages.java.lang);

var file = new File("C:/Users/chris/Downloads/helloworld.svg");
var ist = new FileInputStream(file);
var lengthi = file.length();

bytesa = new ByteArrayOutputStream( lengthi);
var c;
while((c=ist.read()) != -1){
bytesa.write(c);
}
ist.close();

this.data = bytesa.toByteArray();

-- end code --

The SVG wasn't displayed and there was no error


Then since I wasn't sure if it needed to be transcoded, I tried:

-- begin code --

try {

importPackage(Packages.java.io);
importPackage(Packages.java.lang);

var t = new Packages.org.apache.batik.transcoder.image.PNGTranscoder();
var file = new File("C:/Users/chris/Downloads/helloworld.svg");
var ist = new FileInputStream(file);
var s = new Packages.java.lang.String(ist.toString());
var bais = new Packages.java.io.ByteArrayInputStream(s.getBytes());
var input = new Packages.org.apache.batik.transcoder.TranscoderInput(bais);
var baos = new Packages.java.io.ByteArrayOutputStream();
var output = new Packages.org.apache.batik.transcoder.TranscoderOutput(baos);
t.transcode(input, output);
this.data = baos.toByteArray();

} catch (e) {
Packages.javax.swing.JOptionPane.showMessageDialog(null, e);
}

-- end code --

This resulted in the error

JavaException org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception
Content is not allowed in prolog.
Re: Dynamic SVG Image: Item is not supported [message #778775 is a reply to message #778715] Fri, 13 January 2012 14:57 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you try the attached example?

Jason


On 1/13/2012 12:28 PM, Chris Harrington wrote:
> I also tried doing it in onCreate()
>
> First, I tried using it directly:
>
> -- begin code --
>
> importPackage(Packages.java.io);
> importPackage(Packages.java.lang);
>
> var file = new File("C:/Users/chris/Downloads/helloworld.svg");
> var ist = new FileInputStream(file);
> var lengthi = file.length();
>
> bytesa = new ByteArrayOutputStream( lengthi);
> var c;
> while((c=ist.read()) != -1){
> bytesa.write(c);
> }
> ist.close();
>
> this.data = bytesa.toByteArray();
>
> -- end code --
>
> The SVG wasn't displayed and there was no error
>
>
> Then since I wasn't sure if it needed to be transcoded, I tried:
>
> -- begin code --
>
> try {
>
> importPackage(Packages.java.io);
> importPackage(Packages.java.lang);
>
> var t = new Packages.org.apache.batik.transcoder.image.PNGTranscoder();
> var file = new File("C:/Users/chris/Downloads/helloworld.svg");
> var ist = new FileInputStream(file);
> var s = new Packages.java.lang.String(ist.toString());
> var bais = new Packages.java.io.ByteArrayInputStream(s.getBytes());
> var input = new Packages.org.apache.batik.transcoder.TranscoderInput(bais);
> var baos = new Packages.java.io.ByteArrayOutputStream();
> var output = new
> Packages.org.apache.batik.transcoder.TranscoderOutput(baos);
> t.transcode(input, output);
> this.data = baos.toByteArray();
> } catch (e) {
> Packages.javax.swing.JOptionPane.showMessageDialog(null, e);
> }
>
> -- end code --
>
> This resulted in the error
>
> JavaException org.apache.batik.transcoder.TranscoderException: null
> Enclosed Exception
> Content is not allowed in prolog.
>


Jason Weathersby

BIRT Exchange
Re: Dynamic SVG Image: Item is not supported [message #778804 is a reply to message #778775] Fri, 13 January 2012 16:46 Go to previous messageGo to next message
Chris Harrington is currently offline Chris Harrington
Messages: 10
Registered: January 2012
Junior Member
Hi Jason,

It runs without error, but it didn't render the SVN. I've attached an image of the output.
I installed the BIRT reporting version of Eclipse about two weeks ago, so I should be current. I've also attached a dump of my configuration.

Many thanks for your assistance!

- Chris
Re: Dynamic SVG Image: Item is not supported [message #778838 is a reply to message #778804] Fri, 13 January 2012 18:20 Go to previous messageGo to next message
Chris Harrington is currently offline Chris Harrington
Messages: 10
Registered: January 2012
Junior Member
Hi Jason,
I noticed that your report file has BIRT Designer Version 2.6.1, and I am using Version 3.7.1. Is that relevant?

What I am ultimately needing to do is modify an SVG template based upon data fields. I think the options are
a) request an SVG via a url with a querystring, and have a the servlet load, modify, and return the SVG
b) load an SVG in the onRender event and using script modify the SVG DOM before transcoding
c) some other approach I haven't considered.

But first I need to get working a simple example of a dynamic SWF.
Re: Dynamic SVG Image: Item is not supported [message #780355 is a reply to message #778838] Tue, 17 January 2012 11:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Chris,

This worked for me in 3.7.1 as well. Can you look at your preferences:

Window->preferences->Report Design->Preview and check the box to Always
use external browsers. Then click on the Web Browser link below the
checkbox to verify that it is using firefox?

Jason


On 1/13/2012 6:20 PM, Chris Harrington wrote:
> Hi Jason,
> I noticed that your report file has BIRT Designer Version 2.6.1, and I
> am using Version 3.7.1. Is that relevant?
>
> What I am ultimately needing to do is modify an SVG template based upon
> data fields. I think the options are
> a) request an SVG via a url with a querystring, and have a the servlet
> load, modify, and return the SVG
> b) load an SVG in the onRender event and using script modify the SVG DOM
> before transcoding
> c) some other approach I haven't considered.
>
> But first I need to get working a simple example of a dynamic SWF.


Jason Weathersby

BIRT Exchange
Re: Dynamic SVG Image: Item is not supported [message #781116 is a reply to message #720979] Fri, 20 January 2012 10:21 Go to previous messageGo to next message
Chris Harrington is currently offline Chris Harrington
Messages: 10
Registered: January 2012
Junior Member
Hi Jason,
That did the trick. Thanks much for your assistance.

- Chris
Re: Dynamic SVG Image: Item is not supported [message #782891 is a reply to message #780355] Tue, 24 January 2012 11:48 Go to previous messageGo to next message
Chris Harrington is currently offline Chris Harrington
Messages: 10
Registered: January 2012
Junior Member
How to load SVG from a URL?

I can do this to load an image from a URL:

try {

importPackage(Packages.java.io);
importPackage(Packages.java.lang);
importPackage(Packages.java.net);
importPackage(Packages.javax.imageio);

var myurl = new Packages.java.net.URL("http://localhost/welcome.png");

var img = ImageIO.read(myurl);
bas = new ByteArrayOutputStream();
ImageIO.write(img, "png", bas);
this.data = bas.toByteArray();

} catch (e) {
Packages.javax.swing.JOptionPane.showMessageDialog(null, e);
}


But I can't figure out how to do the same for an SVG image. Thanks for any guidance.

- Chris
Re: Dynamic SVG Image: Item is not supported [message #783012 is a reply to message #782891] Tue, 24 January 2012 17:32 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Why not use a URI image and just set the uri in the editor or in script
like:

var myurl = new Packages.java.net.URL("yoururltosvg");
this.URI = myurl;

Jason

On 1/24/2012 11:48 AM, Chris Harrington wrote:
> How to load SVG from a URL?
>
> I can do this to load an image from a URL:
>
> try {
>
> importPackage(Packages.java.io);
> importPackage(Packages.java.lang);
> importPackage(Packages.java.net);
> importPackage(Packages.javax.imageio);
>
> var myurl = new Packages.java.net.URL("http://localhost/welcome.png");
>
> var img = ImageIO.read(myurl);
> bas = new ByteArrayOutputStream();
> ImageIO.write(img, "png", bas);
> this.data = bas.toByteArray();
>
> } catch (e) {
> Packages.javax.swing.JOptionPane.showMessageDialog(null, e);
> }
>
>
> But I can't figure out how to do the same for an SVG image. Thanks for
> any guidance.
>
> - Chris


Jason Weathersby

BIRT Exchange
Re: Dynamic SVG Image: Item is not supported [message #783928 is a reply to message #783012] Thu, 26 January 2012 14:07 Go to previous messageGo to next message
Chris Harrington is currently offline Chris Harrington
Messages: 10
Registered: January 2012
Junior Member
I tried that, both in onCreate() and onRender(). There was no error but nothing was drawn.
Re: Dynamic SVG Image: Item is not supported [message #783933 is a reply to message #783012] Thu, 26 January 2012 14:26 Go to previous messageGo to next message
Chris Harrington is currently offline Chris Harrington
Messages: 10
Registered: January 2012
Junior Member
Here's more details on my results so far. Some things work properly with some methods, but there are certainly lots of issues.

Method 1:
-----------

code:

importPackage(Packages.java.io);
importPackage(Packages.java.lang);

var file = new File("C:/inetpub/wwwroot/spaceship3.svg");
var ist = new FileInputStream(file);
var lengthi = file.length();

bytesa = new ByteArrayOutputStream( lengthi);
var c;
while((c=ist.read()) != -1){
bytesa.write(c);
}
ist.close();

this.data = bytesa.toByteArray();

results:

In report viewer, the SVG image is displayed. The render quality is high. Onload()
script in SVG is executted and rendered results reflect DOM operations done in script.

In PDF, the SVG image is displayed but the transparency is lost (transparency was
present in web viewer). Onload() script operations are not reflected in rendered
results.


Method 2:
----------------

code:

var url = new Packages.java.net.URL("http://localhost/sendsvg.aspx?score=5&m=3&sd=2");
this.URI = url;

results:

The SVG image is not rendered.

Method 3:
-----------------

code:

importPackage(Packages.java.io);
importPackage(Packages.java.lang);
importPackage(Packages.java.net);

var t = new Packages.org.apache.batik.transcoder.image.PNGTranscoder();

var url = new Packages.java.net.URL("http://localhost/sendsvg.aspx?score=5&m=3&sd=2");
var conn = url.openConnection();
var inp = conn.getInputStream();

var input = new Packages.org.apache.batik.transcoder.TranscoderInput(inp);
var baos = new Packages.java.io.ByteArrayOutputStream();
var output = new Packages.org.apache.batik.transcoder.TranscoderOutput(baos);
t.transcode(input, output);
this.data = baos.toByteArray();

results:

The SVG is rendered in the report viewer. Rendering quality is not as good
as in Method 2. Transparency is rendered properly. Onload() script in SVG
in not reflected in rendering.

In the PDF, rendering quality is not so good, transparency works, onload() is
not reflected in results.
Re: Dynamic SVG Image: Item is not supported [message #784503 is a reply to message #783933] Fri, 27 January 2012 11:17 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

In method 1 are you running to html in the viewer and then exporting to pdf?

Jason

On 1/26/2012 2:26 PM, Chris Harrington wrote:
> Here's more details on my results so far. Some things work properly with
> some methods, but there are certainly lots of issues.
>
> Method 1:
> -----------
>
> code:
>
> importPackage(Packages.java.io);
> importPackage(Packages.java.lang);
>
> var file = new File("C:/inetpub/wwwroot/spaceship3.svg");
> var ist = new FileInputStream(file);
> var lengthi = file.length();
>
> bytesa = new ByteArrayOutputStream( lengthi);
> var c;
> while((c=ist.read()) != -1){
> bytesa.write(c);
> }
> ist.close();
>
> this.data = bytesa.toByteArray();
>
> results:
>
> In report viewer, the SVG image is displayed. The render quality is
> high. Onload()
> script in SVG is executted and rendered results reflect DOM operations
> done in script.
>
> In PDF, the SVG image is displayed but the transparency is lost
> (transparency was
> present in web viewer). Onload() script operations are not reflected in
> rendered
> results.
>
>
> Method 2:
> ----------------
>
> code:
>
> var url = new
> Packages.java.net.URL("http://localhost/sendsvg.aspx?score=5&m=3&sd=2");
> this.URI = url;
>
> results:
>
> The SVG image is not rendered.
>
> Method 3:
> -----------------
>
> code:
>
> importPackage(Packages.java.io);
> importPackage(Packages.java.lang);
> importPackage(Packages.java.net);
>
> var t = new Packages.org.apache.batik.transcoder.image.PNGTranscoder();
> var url = new
> Packages.java.net.URL("http://localhost/sendsvg.aspx?score=5&m=3&sd=2");
> var conn = url.openConnection();
> var inp = conn.getInputStream();
>
> var input = new Packages.org.apache.batik.transcoder.TranscoderInput(inp);
> var baos = new Packages.java.io.ByteArrayOutputStream();
> var output = new
> Packages.org.apache.batik.transcoder.TranscoderOutput(baos);
> t.transcode(input, output);
> this.data = baos.toByteArray();
> results:
>
> The SVG is rendered in the report viewer. Rendering quality is not as good
> as in Method 2. Transparency is rendered properly. Onload() script in SVG
> in not reflected in rendering.
> In the PDF, rendering quality is not so good, transparency works,
> onload() is
> not reflected in results.
>


Jason Weathersby

BIRT Exchange
Re: Dynamic SVG Image: Item is not supported [message #784550 is a reply to message #784503] Fri, 27 January 2012 12:30 Go to previous messageGo to next message
Chris Harrington is currently offline Chris Harrington
Messages: 10
Registered: January 2012
Junior Member
Yes.
Re: Dynamic SVG Image: Item is not supported [message #786589 is a reply to message #784550] Mon, 30 January 2012 10:56 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Chris,

Can you open a bugzilla request for this?

Jason

On 1/27/2012 12:30 PM, Chris Harrington wrote:
> Yes.


Jason Weathersby

BIRT Exchange
Previous Topic:Error While Creating Data Source
Next Topic:Internet Explorer 9 not displaying BIRT 2.5 reports
Goto Forum:
  


Current Time: Wed Apr 16 09:31:44 EDT 2014

Powered by FUDForum. Page generated in 0.04753 seconds