robertsv Posted October 27, 2008 Share Posted October 27, 2008 Hello :) in order to show text which doesn't fit in the textField - I set isStretchWithOverflow="true". Exporting to excel - this solves the problem only partially (the row height is increased, but not enough). If I understand correctly - there is no real solution for this problem?! Link to comment Share on other sites More sharing options...
lucianc Posted October 29, 2008 Share Posted October 29, 2008 Have you tried setting the IS_FONT_SIZE_FIX_ENABLED export flag (or the corresponding net.sf.jasperreports.export.xls.font.size.fix.enabled property) to true?Regards,Lucian Link to comment Share on other sites More sharing options...
robertsv Posted October 30, 2008 Author Share Posted October 30, 2008 yes i have tried - it makes the font smaller but doesn't solve the problem. Link to comment Share on other sites More sharing options...
shrije Posted October 30, 2008 Share Posted October 30, 2008 This is a major issue which we can see the demo samples too that go along with JR Distribution. I have verified this. The issue is that POI api used does not change the height of the cells. Link to comment Share on other sites More sharing options...
lucianc Posted October 31, 2008 Share Posted October 31, 2008 Log this as a bug if you think it's a major issue. However, I'm not sure what we can do about it given that POI doesn't offer any functionality to address this.Regards,Lucian Link to comment Share on other sites More sharing options...
vivekmehtani Posted November 3, 2008 Share Posted November 3, 2008 Hi,I am facing the same problem does jasper reports support any of the following options1. Can jasper support adding an excel macro2. Can jasper overwrite / append to an existing excel file (which contains a macro)3. In jasper is there any way of explictly setting a row height (other than modifying the jrxml template)4. can this be done for a particular row and not for entire excel5. Is there any option to expand column width at run timeplease suggest ?Regards,Vivek Link to comment Share on other sites More sharing options...
iscribble Posted March 2, 2009 Share Posted March 2, 2009 robertsvWrote: Hello :) in order to show text which doesn't fit in the textField - I set isStretchWithOverflow="true". Exporting to excel - this solves the problem only partially (the row height is increased, but not enough). If I understand correctly - there is no real solution for this problem?! Has anyone come up with a solution to this problem yet? Link to comment Share on other sites More sharing options...
iscribble Posted April 15, 2009 Share Posted April 15, 2009 It seems that there isn't a fix for this...I wonder then, is there a way to specify a fixed row height increase when exporting to XLS? That is, I'd like to keep my heights dynamic (stretch with overflow, etc) but on an XLS export, is there a way to say "make all rows 20 percent taller?" ...or is this exactly what lucianc was saying that there is no POI capability for? Link to comment Share on other sites More sharing options...
lucianc Posted April 17, 2009 Share Posted April 17, 2009 iscribbleWrote: It seems that there isn't a fix for this... I wonder then, is there a way to specify a fixed row height increase when exporting to XLS? That is, I'd like to keep my heights dynamic (stretch with overflow, etc) but on an XLS export, is there a way to say "make all rows 20 percent taller?" ...or is this exactly what lucianc was saying that there is no POI capability for? There is no built-in feature to adjust the XLS row heights by a fixed ratio. Log a feature request for this if you think it would be useful.What I meant was that (afaik) POI does not support automatic adjusting of the row heights based on the cell contents. So something like what you suggested (make all row heights 20% bigger) is possible, but making the rows exactly as tall as they need to be in order to fit the cell texts might not be possible.Regards,Lucian Link to comment Share on other sites More sharing options...
iscribble Posted April 17, 2009 Share Posted April 17, 2009 Thanks Lucian, I do think that this feature would be useful. I have added a feature request, #3813. Link to comment Share on other sites More sharing options...
aschinch Posted November 10, 2009 Share Posted November 10, 2009 I am also in need of embedding excel macro with Jasper reports.Similarly I need to use existing excel pivot tables with Jasper reports.Can someone update on these questions?1. Can jasper support adding an excel macro2. Can jasper overwrite / append to an existing excel file (which contains a macro or pivot table)Thanks,Avinash Link to comment Share on other sites More sharing options...
mbarnard Posted April 27, 2010 Share Posted April 27, 2010 I was able to improve the Excel row height problem (but not completely fix it) by making a small change in the JExcelApiExporter, and recompiling the jar. This is JasperReports 3.5.3. In the code below I changed the multiplier from 20 to 30. It seems as though this provides an initial row height value, which Excel will later increase if the cell has a lot of content, but Excel often gets the calculation wrong.But it is strange because Excel doesn't make a mistake on the files it generates, so I think there is something strange about the way JExcel generates xls files. protected void setRowHeight(int y, int lastRowHeight) throws JRException{ try { // sheet.setRowView(y, (lastRowHeight * 20)); // twips sheet.setRowView(y, (lastRowHeight * 30)); // twips } catch (RowsExceededException e) { throw new JRException("Error generating XLS report : " + jasperPrint.getName(), e); }} Link to comment Share on other sites More sharing options...
rw-network Posted May 7, 2010 Share Posted May 7, 2010 I am also having an issue with the cell height vs content in excel output.POI may not have the ability to auto adjust the cell height based on content, but why is JasperReports not figuring out the correct cell height before it gets to POI? If Jasper can tell that a given field is going to wrap and isStretchWithOverflow="true" and output is xls, double the cell height passed to POI. Or some complicated formula along those lines. :)Thanks, Scott Link to comment Share on other sites More sharing options...
meta Posted October 21, 2010 Share Posted October 21, 2010 Hi,i'm in the same trouble, and it would be very appreciated if these two issues have an answer:1. Can jasper support adding an excel macro2. Can jasper overwrite / append to an existing excel file (which contains a macro)Thanks in advance, Link to comment Share on other sites More sharing options...
teodord Posted October 21, 2010 Share Posted October 21, 2010 Hi, JR does not support these very specific Excel features, mostly because JR is not an XLS generating library.You should check the Apache POI or the JExcelApi library to see if they support these two features. Thanks,Teodor Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now