Diplaying image or chart report in JSP or HTML [message #116996] |
Thu, 26 January 2006 02:18  |
Eclipse User |
|
|
|
Originally posted by: sri.gmail.com
hi
i am trying to diaply image or chart report which is designed using birt
report designer.
i used following code to generate HTML output
EngineConfig config = new EngineConfig( );
config.setEngineHome( "E:\\birt" );
HTMLEmitterConfig hc = new HTMLEmitterConfig( );
HTMLCompleteImageHandler imageHandler = new HTMLCompleteImageHandler( );
hc.setImageHandler( imageHandler );
config.setEmitterConfiguration( HTMLRenderOption.OUTPUT_FORMAT_HTML, hc );
ReportEngine engine = new ReportEngine( config );
IReportRunnable report = null;
try{
report = engine.openReportDesign( name );
}catch ( EngineException e ){
System.err.println( "Report " + name + " not found!\n" );
engine.destroy( );
return;
}
if ( showInfo ) {
showReportInfo( engine, report );
}
if ( format != null ){
parseParams( engine, report, params );
IRunAndRenderTask task = engine.createRunAndRenderTask( report );
HTMLRenderOption options = new HTMLRenderOption( );
options.setOutputFormat( format );
String output = name.replaceFirst( ".rptdesign", "." + format );
options.setOutputFileName( output );
task.setRenderOption( options );
task.setParameterValues( params );
try{
task.run( );
}
catch ( EngineException e1 ) {
System.err.println( "Report " + name + " run failed.\n" );
System.err.println( e1.toString( ) );
}
}
engine.destroy( );
}
This code is working fine with Simple reports which contain Tables but its
not working fine with reports which contain images or charts
this code is generating .html file for image reports but image is not
printing.
and aslo i am not clear with the following comments
// HTML reports can have embedded images or charts. Set up the
configuration
// required to write these into a directory in the output directory.
// The HTMLCompleteImageHandler is one provided by BIRT for this purpose.
// Your application can create a customized version to provide alternative
// ways to handle images.
Soultion is very URGENT PLEASE HELP ME REGARDING THIS
SRI
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03810 seconds