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

dencel

Members
  • Posts

    5
  • Joined

  • Last visited

dencel's Achievements

Rookie

Rookie (2/14)

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

Recent Badges

0

Reputation

  1. Hello, I have a simple table order(id(pk),amount(integer)) and I want tot use this table to print orderlabels for shipment. I want to print a label for each package (amount), the question is how to do this. I am using a sql connection as resource for my report. Option 1: explode the resultset, I think this is an ugly solution Option 2: ?? I hope somebody has a logical solution to help me. Thanks in advance, Dencel
  2. The problem I was having with subreports is the overflow when the datasource has more detailrecords then the 1st report can display. Jasper doesn't like it and crashed sometimes. The iText example page came to the rescue with examples like concat and twoOnOne. Now I create the pdf with jasper, concat some reports and then place two on one. I am working at a transport company where we use about 1000 A4 pages each day thus saving 500 pages each day (Take that Al Gore!;)). I made a simple tool for it which takes a xml file and is configured like: Code: <operation action="concat"> <operation action="toA4"> <report name="MYREPORTNAME"> <param name="IMAGE_DIR">c:mypath</param> </report> </operation> </operation> If anybody likes to have it, I will post it online (if you don't mind my bash coding style). Anyway just wanted to share the knowledge. Thanks for the replies, they are usefull!
  3. Thanks, that is good tip. But I am doing some editing on the pdf doc using iText. I am creating A5 size prints using Jasper and then reformat them on a A4 thus saving the company some printingcosts ;). As far as I know this is not possible using Jasper (?).
  4. Just posting my findings with printing pdf files silent from a java application. Beside some commercial products there are no good solutions to do this, at least I didn't find them. The solution is to use a external program and call it with Runtime.getRuntime().exec(). There are two tools I've tested: 1. Acrobat reader Command: acrord32 /t "<docname>" "<printername>" For more information look at the developers FAQ doc of acrobat reader for all commandline parameters. The parameters are not supported! I had problems printing using acrobat reader because it messed up all kind of characters when printing it silent, really weird. I decided to use program 2. 2. Ghostscript + gsprint Command: gsprint -printer "<printer>" "<docname>" These tools are free. GSprint is delivered with gsview. They are not very fast but work really good. Hint: from windows, don't use spaces in the command and start a new command process for each process: cmd.exe /C start C:Progra~1Ghostgumgsviewgsprint.exe -printer "<printer>" "<docname>"
  5. I just made an utilty class to print Avery Zweckform labels. Only Zweckform 3483,3655 and 3660 are implemented at this time. Usage: Drop the binary jar in the zipfile in your classpath and use the code like this: ======== public JasperPrint getAveryPrint(JRDataSource orginalDataSource,String orginalReportFile,Map params,FormType formType) throws JRException{ JasperReport jasperReport = AveryHelper.getReportWrapper(formType); params.put("AVERY_REPORT_ELEMENT",orginalReportFile); JRDataSource dataSource = AveryHelper.getDataSourceWrapper(orginalDataSource); return JasperFillManager.fillReport( jasperReport, params,dataSource); } myPrint = getJasperPrint(orginalDS,orginalJasperFile, new HashMap<String,String>(), AveryHelper.FormType.ZWECKFORM_3483); ======== The forms are not extensively tested, so it may require tuning. You can simply adjust the reports in the sources. If you need help message me. JDK 1.5 coded. [file name=avery.zip size=55013]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/avery.zip[/file]
×
×
  • Create New...