Excel Cell border not displayed

0

Hi,
When I preview/export the Jasper Report to an excel sheet, it exports the jasper report data successfully but it doesn't show the border around the cell.
I have attached zip file containing 2 screen shots for your reference. ExcelExport1.jpg shows how iReport does it currently. And ExcelExport2.jpg shows how I want to get it (with cell borders).

Please let me know if its possible to have cell borders in exported excel sheet or not.

Thanks in advance...

[file name=screenshots.zip size=5513]
Post edited by: ireportDev, at: 2008/04/02 15:37

Attachments: 
ireportDev's picture
Joined: Mar 11 2008 - 11:46pm
Last seen: 11 years 8 months ago

14 Answers:

1

We are using JasperServer 4.2.1 and had this problem for a while.  I also found that the issue could be resolved by setting net.sf.jasperreports.export.xls.ignore.cell.border property to false as brought out by neo_lestat.  I outlined how I fixed this and other related issues here: http://gotochriswest.com/blog/2012/03/20/jasperreport-excel-option/.



Post Edited by cwest at 03/21/2012 19:54
cwest's picture
26
Joined: Jan 27 2011 - 12:25pm
Last seen: 8 years 9 months ago
1
If you have Excel set to view gridlines you should see the boxes around the cells. If you are creating boxes in your report then no they will not be carried over to Excel. Items like boxee, colored items, and images are not carried over to Excel.
svenn's picture
1383
Joined: Mar 19 2007 - 5:57am
Last seen: 12 years 8 months ago
0
Pls let me know how to set "View Grid line" option to see the cell boarders.
ireportDev's picture
Joined: Mar 11 2008 - 11:46pm
Last seen: 11 years 8 months ago
0
View gridlines as I said is something that you set in Excel. How and where you set it depends on the version of Excel that you are using. Look in your Excel help to see how to turn it on in your version of Excel.
svenn's picture
1383
Joined: Mar 19 2007 - 5:57am
Last seen: 12 years 8 months ago
0
Grid is enabled in Excel. the reason why its not showing the border is that by default the background color of the cells is white. If we make bk color as "no fill" in excel it displays the cell border.
Anyways thanks for ur help....
ireportDev's picture
Joined: Mar 11 2008 - 11:46pm
Last seen: 11 years 8 months ago
0
I'm a newbie to iReport tool. Excel cell borders are not displayed when i run the jrxml file on tomcat server .please let me know the reason behind. If i generate excel using excel viewer i'm able to see the cell borders in the gerated excel file ,but not able to find borders when we run on tomcat server as well when we try to view uisng JRViewer Preview of iReport. Can you please guide us to fix this ?
honeyani's picture
Joined: Sep 10 2008 - 3:07am
Last seen: 11 years 2 months ago
0

Same issue faced ,Grid is enabled in Excel. bk color for cell existing as "no fill",...still not able to see the cell border in JRReviewer preview or when we run(jrxml) on tomcat server y?

honeyani's picture
Joined: Sep 10 2008 - 3:07am
Last seen: 11 years 2 months ago
0

honeyani
Wrote:
 

Same issue faced ,Grid is enabled in Excel. bk color for cell existing as "no fill",...still not able to see the cell border in JRReviewer preview or when we run(jrxml) on tomcat server y?

 

I fixed this.............!!! It works..!

honeyani's picture
Joined: Sep 10 2008 - 3:07am
Last seen: 11 years 2 months ago
0

Hi I am facing the same problem ie the excel generated is without cell borders.This thread ended vaguely without any solution.
I request anyone who knows the solution to post it here.I urgently require it



Post Edited by DEVESH GUPTA at 03/16/09 18:19
devgupt123's picture
Joined: Mar 16 2009 - 11:07am
Last seen: 10 years 8 months ago
0

In iReport, check the 'Transparent' box in the properties dialog of the field you require the border on.  That fixes the problem for me.

jrechter's picture
Joined: Dec 17 2008 - 10:15am
Last seen: 3 years 11 months ago
0

Thanks for the info but I am not using iReport. The Jasper API is directly used to export reports in xls format and the cell borders are missing.Please tell me how I can show cell borders without iReport

devgupt123's picture
Joined: Mar 16 2009 - 11:07am
Last seen: 10 years 8 months ago
0

"Thanks for the info but I am not using iReport."

 

In this case you'll get better help by posting to the JasperReports forum instead of the iReport forum.

 

Regards,
Matt

mdahlman's picture
10570
Joined: Mar 13 2007 - 2:43am
Last seen: 5 years 4 days ago
0

 Hi, I was searching for put the cell borders in excel whit jasperreport and I found it, I looked the api, you have tu pass some properties to jasperreport, I'm using this:

String reportSource = "report.jasper";

 HashMap parameters= new HashMap();
  parameters.put(JRParameter.IS_IGNORE_PAGINATION, true);
  JasperReport jasperReport = (JasperReport) JRLoader.loadObject(reportSource);
  JasperPrint jasperPrint =
  JasperFillManager.fillReport(jasperReport, parameters, connection);

  JExcelApiExporter exporter = new JExcelApiExporter();
  exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
  exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, tempFile);
  exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, false);
  exporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, true);

// These are the parameters, the first is to put the border cell and the second is to disable de background

  exporter.setParameter(JRXlsExporterParameter.IS_IGNORE_CELL_BORDER, false);
  exporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, false);


  exporter.exportReport();

I'm using jasperreport 3, good luck !!!

 

neo_lestat's picture
Joined: Apr 1 2009 - 10:07am
Last seen: 5 years 11 months ago
0

Change the cell border property.

I documented the steps that worked for me here. http://java.sg/jasper-reports-excel-not-showing-cell-border/

chinboon's picture
Joined: Jan 8 2011 - 8:48pm
Last seen: 8 years 10 months ago
Feedback
randomness