Skip to main content



      Home
Home » Archived » BIRT » Chart image in HTML file
Chart image in HTML file [message #60435] Thu, 21 July 2005 03:47 Go to next message
Eclipse UserFriend
Hi,

I’m trying to run the HTML format using RunReport example, but I get in
the output HTML file only the table information and empty box for chart
image.

The log info:
[INFO]: (ECLIPSE-ENV) Creating dsp
org.eclipse.birt.chart.datafeed.DataSetProcessorImpl
[INFO]: (ECLIPSE-ENV) Creating dsp
org.eclipse.birt.chart.datafeed.DataSetProcessorImpl
[INFO]: (ECLIPSE-ENV) Creating dsp
org.eclipse.birt.chart.datafeed.DataSetProcessorImpl
[INFO]: ChartReportItemPresentationImpl: onRowSets(...) - building chart
[INFO]: Writing to PNG file at
C:\DOCUME~1\TAAOS~1.REM\LOCALS~1\Temp\chart36306.PNG
[INFO]: SWING Display Server: Sun Microsystems Inc. v1.4.2_05
[INFO]: (ECLIPSE-ENV) Creating display server ds.SWING as
org.eclipse.birt.chart.device.swing.SwingDisplayServer
[INFO]: (ECLIPSE-ENV) Creating device dv.PNG as
org.eclipse.birt.chart.device.image.PngRendererImpl
[INFO]: Presentation uses bounds
bo=org.eclipse.birt.chart.model.attribute.impl.BoundsImpl@c59ad5 (left:
0.0, top: 0.0, width: 432.75, height: 380.25)
[INFO]: (ECLIPSE-ENV) Creating series renderer
org.eclipse.birt.chart.render.Pie
[INFO]: (ECLIPSE-ENV) Creating series renderer
org.eclipse.birt.chart.render.Pie
[INFO]: Time to compute plot (without axes) = 297 ms
[INFO]: ChartReportItemPresentationImpl: onRowSets(...) - rendering chart
[INFO]: Using graphics context
sun.java2d.SunGraphics2D[font=java.awt.Font[family=Dialog,na me=Dialog,style=plain,size=12],color=java.awt.Color[r=255,g= 255,b=255]]
[INFO]: org.eclipse.birt.chart.render.EmptyWithoutAxes: renderSeries()
[1/3]
[INFO]: {0}: renderSeries() [{1}/{2}]org.eclipse.birt.chart.render.Pie23
[INFO]: {0}: renderSeries() [{1}/{2}]org.eclipse.birt.chart.render.Pie33
[INFO]: Time to render everything = 203 ms
[INFO]: Using {0} image writer
{1}pngcom.sun.imageio.plugins.png.PNGImageWriter
[INFO]: ChartReportItemPresentationImpl: onRowSets(...) - end
[INFO]: ChartReportItemPresentationImpl: finish(...) - start
[INFO]: Successfully deleted temporary PNG file created at
C:\DOCUME~1\TAAOS~1.REM\LOCALS~1\Temp\chart36306.PNG
[INFO]: ChartReportItemPresentationImpl: finish(...) - end
Jul 21, 2005 9:26:50 AM org.eclipse.birt.data.engine.impl.DataEngineImpl
shutdown
INFO: Data engine shuts down

The output html source code for image:

<script language="JavaScript">
function fixPNG(myImage) // correctly handle PNG transparency in Win
IE 5.5 or higher.
{
if (window.ie55up)
{
var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
var imgClass = (myImage.className) ? "class='" +
myImage.className + "' " : ""
var imgTitle = (myImage.title) ? "title='" + myImage.title + "'
" : "title='" + myImage.alt + "' "
var imgStyle = "display:inline-block;" + myImage.style.cssText
var strNewHTML = "<span " + imgID + imgClass + imgTitle
strNewHTML += " style=\"" + "width:" + myImage.width + "px;
height:" + myImage.height + "px;" + imgStyle + ";"
strNewHTML +=
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
strNewHTML += "(src=\'" + myImage.src + "\',
sizingMethod='scale');\"></span>"
myImage.outerHTML = strNewHTML
}
}
</script>


Does anybody know what going here wrong?

Thanks,
Said
Re: Chart image in HTML file [message #60457 is a reply to message #60435] Thu, 21 July 2005 03:57 Go to previous messageGo to next message
Eclipse UserFriend
For this purpose the following code is used in RunReport example:

HTMLEmitterConfig hc = new HTMLEmitterConfig( );
HTMLCompleteImageHandler imageHandler = new HTMLCompleteImageHandler( );
hc.setImageHandler( imageHandler );
config.setEmitterConfiguration( HTMLRenderOption.OUTPUT_FORMAT_HTML, hc
);

But this code is already defined in the EngineConfig constructor:

EngineConfig config = new EngineConfig( );
Re: Chart image in HTML file [message #60997 is a reply to message #60435] Fri, 22 July 2005 05:13 Go to previous messageGo to next message
Eclipse UserFriend
Greeting,

For resolving the issue you mentioned, please add the following code into
RunReport.java.

HTMLRenderContext renderContext = new HTMLRenderContext();
task.setContext(renderContext);

If you'd like to put the output images into a designated folder, please
add: renderContext.setImageDirectory("folderName");

Cheers.

Regards,
Nina
Re: Chart image in HTML file [message #61022 is a reply to message #60457] Fri, 22 July 2005 05:23 Go to previous message
Eclipse UserFriend
Greeting,

Yes, the code you mentioned above is already defined in the EngineConfig
constructor. So it could be deleted from RunReport.java.

Cheers.

Regards,
Nina
Previous Topic:Chart HTML and no image src tag
Next Topic:RunReport
Goto Forum:
  


Current Time: Tue Jul 01 12:00:40 EDT 2025

Powered by FUDForum. Page generated in 0.04813 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top