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

tomkast

Members
  • Posts

    24
  • Joined

  • Last visited

tomkast's Achievements

Explorer

Explorer (4/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. I need to deal with this again. The problem is that the application has to deal with images of various resolutions. For example, a 96 PPI JPEG image comes out too big in Jasper Reports. Interesting, other applications can handle this, I am no expert, but I would guess that applications look at the image properties, see the PPI, and render the image accordingly. Unless I am missing something, you can't just choose 72 DPI and render/print all images at that resolution, some will be too big, some too small. So I am guessing I need to write a renderer and makes this calculation?
  2. hi, worked on this before, made a dynamic report-design-recompile process, which multipled image height and width by .35, recompiled design (on the fly/web server) and that worked for a while... ...the image is in a subreport and there are cases where the modified report design will cause an endless loop which kills the web server. intereting, i tried to do the same thing in the jasper reports lib, JRPdfExporter.java, and i got the same endless loop in filling the report. when this came up before, teodor had mentioned that i should make the change in itext, which is what i am working on now. but please let me know if you have made any progress on this issue... ...do you have a trac/jira/bugzilla bug for this? thanks, tom
  3. this works: Code: BufferedImage img = ImageIO.read(new File(wo_image_path)); height = img.getHeight(); width = img.getWidth(); jasperSubDesign = JasperManager.loadXmlDesign(context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jrxml")); JRDesignImage image = (JRDesignImage)jasperSubDesign.getPageHeader().getElementByKey("wo_image"); image.setX(3); image.setY(69); image.setHeight(new Long(height - Math.round(height*.35)).intValue()); image.setWidth(new Long(width - Math.round(width*.35)).intValue()); JasperCompileManager.compileReportToFile(jasperSubDesign, context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jasper"));
  4. this works: Code: BufferedImage img = ImageIO.read(new File(wo_image_path)); height = img.getHeight(); width = img.getWidth(); jasperSubDesign = JasperManager.loadXmlDesign(context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jrxml")); JRDesignImage image = (JRDesignImage)jasperSubDesign.getPageHeader().getElementByKey("wo_image"); image.setX(3); image.setY(69); image.setHeight(new Long(height - Math.round(height*.35)).intValue()); image.setWidth(new Long(width - Math.round(width*.35)).intValue()); JasperCompileManager.compileReportToFile(jasperSubDesign, context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jasper"));
  5. this works: Code: BufferedImage img = ImageIO.read(new File(wo_image_path)); height = img.getHeight(); width = img.getWidth(); jasperSubDesign = JasperManager.loadXmlDesign(context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jrxml")); JRDesignImage image = (JRDesignImage)jasperSubDesign.getPageHeader().getElementByKey("wo_image"); image.setX(3); image.setY(69); image.setHeight(new Long(height - Math.round(height*.35)).intValue()); image.setWidth(new Long(width - Math.round(width*.35)).intValue()); JasperCompileManager.compileReportToFile(jasperSubDesign, context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jasper"));
  6. this works: Code: BufferedImage img = ImageIO.read(new File(wo_image_path)); height = img.getHeight(); width = img.getWidth(); jasperSubDesign = JasperManager.loadXmlDesign(context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jrxml")); JRDesignImage image = (JRDesignImage)jasperSubDesign.getPageHeader().getElementByKey("wo_image"); image.setX(3); image.setY(69); image.setHeight(new Long(height - Math.round(height*.35)).intValue()); image.setWidth(new Long(width - Math.round(width*.35)).intValue()); JasperCompileManager.compileReportToFile(jasperSubDesign, context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jasper"));
  7. this works: Code: BufferedImage img = ImageIO.read(new File(wo_image_path)); height = img.getHeight(); width = img.getWidth(); jasperSubDesign = JasperManager.loadXmlDesign(context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jrxml")); JRDesignImage image = (JRDesignImage)jasperSubDesign.getPageHeader().getElementByKey("wo_image"); image.setX(3); image.setY(69); image.setHeight(new Long(height - Math.round(height*.35)).intValue()); image.setWidth(new Long(width - Math.round(width*.35)).intValue()); JasperCompileManager.compileReportToFile(jasperSubDesign, context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jasper"));
  8. this works: Code: BufferedImage img = ImageIO.read(new File(wo_image_path)); height = img.getHeight(); width = img.getWidth(); jasperSubDesign = JasperManager.loadXmlDesign(context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jrxml")); JRDesignImage image = (JRDesignImage)jasperSubDesign.getPageHeader().getElementByKey("wo_image"); image.setX(3); image.setY(69); image.setHeight(new Long(height - Math.round(height*.35)).intValue()); image.setWidth(new Long(width - Math.round(width*.35)).intValue()); JasperCompileManager.compileReportToFile(jasperSubDesign, context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jasper"));
  9. attention teodord -- --please stop me if i am of track -- what i am going to do to get a dynamic image into a pdf, where as the image dimensions remain exactly the same as the original image, is to 1) use java to get the x and y pixel dimensions of image 2 ) parse the JRXML and change the height and width 3) recompile the JRXML into .jasper 4) run the report if this is not the right way, even if we need to pay some money, _please_ reply with the solution. but if this is the right solution, no problem at all, not a lot of code, and it will not impact performance to any noticable degree.
  10. regarding C:\jasperreports-3.6.2\demo\samples\images, when running the pdf sample, it appears that the pdf results for the real size example and real height example (see 2 excerpts below) both are larger than the original image. attached are the original image and the pdf output of the report. what we are looking for is a pdf example where the image is left alone in terms of its original pixel dimensions using a PDF exporter. this way various images can be used, dynamically, and they remain in the original dimensions. Code:<image scaleImage="RealSize"><reportElement x="0" y="0" width="150" height="40"style="imageBox"/><imageExpression>"dukesign.jpg"</imageExpression></image><image scaleImage="RealHeight"><reportElement x="0" y="0" width="100" height="40"style="imageBox"/><imageExpression>"dukesign.jpg"</imageExpression></image>
  11. Really need some help here -- completely lost -- not an "image guy". Reproduce by simply using ireports 3.6.1 and see the internal preview -- images with "Real Size" set still expand to the size of the image tag... am i out to lunch??? :-) ok -- don't answer that....
  12. here is image and pdf -- as you can see pdf image is bigger then source image. this is done with "RealSize" setting on image tag. a lot of similar threads but no answers found. one idea would be to set the width and height of image tag dynamically. can this be done with a parameter?
  13. note: if pdf is at 65% size, then image in exported report is correct, original size... fyi, client needs image in report to be exactly the same size as original for production staff to use sewing embroidery matching image....
  14. hello, using ireports3.6.1, pdf preview, with jpeg image tag like this: <image scaleImage="RealSize" hAlign="Center" vAlign="Middle"> <reportElement positionType="Float" x="2" y="62" width="549" height="146"> <printWhenExpression><![CDATA[$V{PAGE_NUMBER} == 1]]></printWhenExpression> </reportElement> <imageExpression class="java.lang.String"><![CDATA[$P{wo_image_path}]]></imageExpression> </image> the image comes out too big in PDF (about 10% bigger than original). any ideas on how to keep image in exactly (pixel-perfect) size of original jpeg? thanks! tom
  15. ...tried making a subreport for portion of page header band that needs to print on only first page, make page header bank very small and let it stretch with the subreport. this works, page header expands on first page, then shrinks on subsequent pages. but performance is no good. so tried making that subreport use all parameters and no query, but as luck would have it, that subreport has 5 other subreports that each need a db connection/result set... any ideas how to make page header band collapse/shrink rather than expand? thanks!
×
×
  • Create New...