verter Posted July 26, 2007 Share Posted July 26, 2007 To build reports I'm using JasperReport & iReport. I've created report template in iReport and used JRXlsExporter class for data export to MS Excel. All work fine, but I can't set margins and headlines size of excel sheet. How can I do this? Dmitry. Link to comment Share on other sites More sharing options...
codyjasperForge Posted July 26, 2007 Share Posted July 26, 2007 Check the iReport src folder for the Excel exporter class... Or something thereOF... IMO, The exporter class is what you need to investigate. Link to comment Share on other sites More sharing options...
verter Posted July 27, 2007 Author Share Posted July 27, 2007 codyjasperForge:Check the iReport src folder for the Excel exporter class I'm already using exporter class - JRXlsExporter, but I can't find its method or something else to set Excel sheet margins. version of iReport is 1.3.0version of jasperReports is 1.3.0Post edited by: verter, at: 2007/07/27 07:13 Link to comment Share on other sites More sharing options...
teodord Posted July 30, 2007 Share Posted July 30, 2007 Hi, There are two Excel exporters available in JasperReports: JRXlsExporter and JExcelApiExporter.Neither have any parameter for setting the margins.Is it about the margins when printing the sheet? In any case, if setting these margins is not supported by the Excel generating library (POI and/or JExcelAPI) then there is nothing much we can do in JR. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
v_i_y Posted May 12, 2010 Share Posted May 12, 2010 Hi Teodor, thanks for the reply.Has the situation been changed since 2007? I encountered the same problem in the current version (3.7.1) of JR/iReport: JRXlsExporter always set XLS page margins (I mean Excel page setup params) to something like 1.9/2.5 cm for left/top (rigth/bottom) JExcelApiExporter always set them to 0/0 cmSo if 1.9/2.5 are very big for me, I encoraged to use only JExcelApiExporter and set IGNORE_PAGE_MARGINS=FALSE then margins are emulated by adding empty cells with correspondent width/height.So is it still bottleneck in underlying libs (POI, JExcel API)?Do I use correct workaround for the problem? Thanks in advance. Link to comment Share on other sites More sharing options...
v_i_y Posted May 12, 2010 Share Posted May 12, 2010 It seems that POI has method for setting sheet margins:poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Sheet.html#setMargin%28short,%20double%29 Link to comment Share on other sites More sharing options...
tomtom53 Posted December 22, 2010 Share Posted December 22, 2010 Hello viy75, I'm facing the exact same problem with JRXlsExporter so I tried JExcelApiExporter (which set effectively the margins to 0), but I need to set them to 1cm . Did you find any solution (not using POI) ? Thanks 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