Jump to content
We've recently updated our Privacy Statement, available here ×

Set margins to DOCX and avoid warnings?


kumareloaded

Recommended Posts

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

09-07-201516-25-28.png.05a20b3c3b8fe1e10a017e10862d33fe.png

**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

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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...