Jump to content
Changes to the Jaspersoft community edition download ×

venkatesh.kannuru

Members
  • Posts

    1
  • Joined

  • Last visited

venkatesh.kannuru's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare

Recent Badges

0

Reputation

  1. 1.Create a Class as follows:- public class ReportUtils { public static void mirrorLayout(JasperPrint print) { int pageWidth = print.getPageWidth(); for (Iterator it = print.getPages().iterator(); it.hasNext();) { JRPrintPage page = (JRPrintPage) it.next(); mirrorLayout(page.getElements(), pageWidth); } } protected static void mirrorLayout(List elements, int totalWidth) { for (Iterator it = elements.iterator(); it.hasNext();) { JRPrintElement element = (JRPrintElement) it.next(); int mirrorX = totalWidth - element.getX() - element.getWidth(); element.setX(mirrorX); if (element instanceof JRPrintFrame) { JRPrintFrame frame = (JRPrintFrame) element; mirrorLayout(frame.getElements(), frame.getWidth()); } } } } 2. Call this method from your present Class, like follows try { Connection con = JavaConnection.GetCon(); JasperDesign jd = JRXmlLoader.load("report1.jrxml"); // your report path and name JasperReport jr = JasperCompileManager.compileReport(jd); JasperPrint jp = JasperFillManager.fillReport(jr, null, con); ReportUtils.mirrorLayout(print); //for Arabic print right to left mirror JasperPrintManager.printReport(jp,false);// it will send print directly to printer } catch (JRException e) { JOptionPane.showMessageDialog(null, e); }
×
×
  • Create New...