Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [birt-news] Excel Format - Image not displaying

I am also facing same issue .Did u get any solution?


Shomy Jose (ECS), HCL-Industry Solutions wrote:
> 
> 
> Hi,
>  
> I am trying to generate a Excel report with an image.
> But the image is not there in the generated report.
>  
> I have created rptdesign file with an image in it.
> Then I wrote a java program using report engine APIs to generate excel
> report in the specified report.
> Report is gettinng generated in excel format. But still the imga is not
> there.
>  
> I am using BIRT 2.2.0 version which is supporting excel format.
>  
> I am attaching my code which is used for report generation
>  
>  
>  
> import java.util.HashMap;
> import java.util.logging.Level;
>  
> import org.eclipse.birt.core.framework.Platform;
> import org.eclipse.birt.report.engine.api.EngineConfig;
> import org.eclipse.birt.report.engine.api.IReportEngine;
> import org.eclipse.birt.report.engine.api.EngineException;
> import org.eclipse.birt.report.engine.api.HTMLActionHandler;
> import org.eclipse.birt.report.engine.api.EngineConstants;
>  
> import org.eclipse.birt.report.engine.api.RenderOption;
> import org.eclipse.birt.report.engine.api.HTMLRenderOption;
> import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
> import org.eclipse.birt.report.engine.api.IReportRunnable;
> import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
> import org.eclipse.birt.report.engine.api.IReportEngineFactory;
>  
> public class Example {
>  
>  public Example() {
>   System.out.println("-------------Inside constructor");
>  }
>  
>  public static void main(String[] args) {
>   System.out.println("-------------Inside main method");
>   Example reportRunner = new Example();
>   reportRunner.runReport();
>  }
>  
>  private void runReport() {
>   System.out.println("Inside Report Generation");
>   IReportEngine engine = null;
>   IRunAndRenderTask task = null;
>  
>   try {
>    EngineConfig config = new EngineConfig();
>    IReportRunnable design = null;
>  
>  
> config.setEngineHome("D:/ProgramFiles/birt/birt-runtime-2_2_0/ReportEngi
> ne");
>    config.setLogConfig("D:/ProgramFiles/birt/log", Level.ALL);
>  
>    Platform.startup( config );
>    IReportEngineFactory factory = (IReportEngineFactory) Platform
>      .createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>    System.out.println(" ---FACTORY CREATED");
>  
>    engine = factory.createReportEngine( config );
>    System.out.println(" ---REPORT ENGINE CREATED");
>    engine.changeLogLevel( Level.WARNING );
>  
>    //Open the report design
>    design =
> engine.openReportDesign("D:/Workarea/Report-workspace/MyReport/ExampleSc
> ript.rptdesign");
>    System.out.println(" ------------ DESIGN CREATED");
>  
>    //Create task to run and render the report,
>    task = engine.createRunAndRenderTask(design);
>    System.out.println(" ------------ TASK CREATED");
>  
>             HTMLRenderOption options = new HTMLRenderOption();
>  
>    //Set ouptut location
>  
> options.setOutputFileName("D:/ProgramFiles/birt/output/ExampleSciptExcel
> ..xls");
>  
>    //Set output format
>    options.setOutputFormat("xls");
>    //options.setEmitterID("xls");
>    task.setRenderOption(options);
>  
>    //run the report and destroy the engine
>    task.run();
>  
>    System.out.println(" ------------ TASK RUNNING");
>  
>   }
>   catch( Exception exception){
>    exception.printStackTrace();
>   }
>   finally {
>    task.close();
>    engine.shutdown();
>    Platform.shutdown();
>   }
>   System.out.println("Finished");
>  }
> }
>  
> Could anybody help me in solving this problem.
>  
> Regards,
> Shomy
> 
>  
> 
>  
> 
> 
> DISCLAIMER:
> -----------------------------------------------------------------------------------------------------------------------
> 
> The contents of this e-mail and any attachment(s) are confidential and
> intended for the named recipient(s) only.
> It shall not attach any liability on the originator or HCL or its
> affiliates. Any views or opinions presented in 
> this email are solely those of the author and may not necessarily reflect
> the opinions of HCL or its affiliates.
> Any form of reproduction, dissemination, copying, disclosure,
> modification, distribution and / or publication of 
> this message without the prior written consent of the author of this
> e-mail is strictly prohibited. If you have 
> received this email in error please delete it and notify the sender
> immediately. Before opening any mail and 
> attachments please check them for viruses and defect.
> 
> -----------------------------------------------------------------------------------------------------------------------
> _______________________________________________
> birt-news mailing list
> birt-news@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/birt-news
> 
> 

-- 
View this message in context: http://www.nabble.com/Excel-Format---Image-not-displaying-tp12047010p19332958.html
Sent from the Eclipse BIRT - News mailing list archive at Nabble.com.



Back to the top