kumareloaded Posted July 9, 2015 Share Posted July 9, 2015 I've created a document with Jasper. Tried to set margins in the below 3 ways,1. In iReport Designer ` <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Statement_Of_Account" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="595" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bff77fa6-b85e-4996-924b-ee31a3460915">`2. In Jasper Java code`JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameterMap,connect); jasperPrint.setLeftMargin(20); jasperPrint.setRightMargin(20); jasperPrint.setTopMargin(20); jasperPrint.setBottomMargin(20); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos); exporter.exportReport();`3. In Jasper Java code with `JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameterMap,connect); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);exporter.setParameter(JRExporterParameter.OFFSET_X, 20);exporter.setParameter(JRExporterParameter.OFFSET_Y, 20); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos); exporter.exportReport();`With all the above 3 ways I was able to give some spacing between the content and the border but when I do print the below warning appears**This is because the space between the margin and content given by Jasper is also considered as a data(Jasper) in Microsoft Word.**As far as I researched on this, its a known issue in Jasper and I doubt there's a fix for this till now. (If at all there's one please do let me know) Link to comment Share on other sites More sharing options...
benkdishman Posted July 21, 2015 Share Posted July 21, 2015 What verion are you using ? I had this problem in 6.0.0 but it has gone away when I upgraded to 6.1.0. 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