Jump to content

Images to display in Excel sheet


pnvswamy

Recommended Posts

Hi All ,

I am using jasper reports.It was fine .

Now i am facing problem in excel sheet for the image.

I want to generate a report and i want my company logo to place in the report .

Image is displayed to PDF,word formats and in Excel it is not coming

  If any one know please help me.

Code:
And i used the tag in Jrxml like below<image scaleImage="Clip" onErrorType="Icon" isLazy="true"><reportElement x="0" y="0" width="150" height="40"/><imageExpression class="java.lang.String"><![CDATA["http://jasperreports.sourceforge.net/jasperreports.png"]]></imageExpression></image>And in my java i used in 2 ways like 1) Using JExcelApiExporter---------------------------jrExporter = new JExcelApiExporter();/*JRXlsExporter();*/jrExporter.setParameter(JExcelApiExporterParameter.IS_ONE_PAGE_PER_SHEET,Boolean.TRUE);jrExporter.setParameter(JExcelApiExporterParameter.IS_WHITE_PAGE_BACKGROUND,Boolean.FALSE);jrExporter.setParameter(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);//jrExporter.setParameter(JExcelApiExporterParameter.IS_EMBEDDING_IMAGES, Boolean.TRUE);jrExporter.setParameter(JExcelApiExporterParameter.IS_IMAGE_BORDER_FIX_ENABLED,Boolean.TRUE);jrExporter.setParameter(JExcelApiExporterParameter.IS_IGNORE_GRAPHICS,Boolean.FALSE);  2).2nd way using JRXlsExporter ---------------------------------destFile = new File(ServletActionContext.getServletContext().getRealPath("reportDocs")+"/"+docFileName+".xls");jrExporter = new JRXlsExporter();jrExporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET,Boolean.TRUE);jrExporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND,Boolean.FALSE);jrExporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);

Post Edited by pnvswamy at 08/24/2010 03:20
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...