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

markrgli

Members
  • Posts

    16
  • Joined

  • Last visited

markrgli's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. Cool. Will try it out. Thanks guys.
  2. Hi guys. Do you have a timeline on the release of 4.1.3? I'm also having this problem. Thanks.
  3. Hi, I'm exporting a report with a large number of columns into Excel (2003 or lower) and I'm getting the exception below. My report has ~300 columns (variable). I read somewhere that this is because Excel 2003 and lower does not support more than 256 columns. However I am still wondering if there a way to possibly tweak the exporter and export to Excel 2003 with this number of columns. Or do I have no choice but to output to Excel 2007? Thanks. PS: Apologies if this has been discussed before; I searched but couldn't find a topic. Code:Exception in thread "main" java.lang.IllegalArgumentException: Invalid column index (256). Allowable column range for BIFF8 is (0..255) or ('A'..'IV') at org.apache.poi.hssf.usermodel.HSSFCell.checkBounds(HSSFCell.java:926) at org.apache.poi.hssf.usermodel.HSSFCell.<init>(HSSFCell.java:162) at org.apache.poi.hssf.usermodel.HSSFRow.createCell(HSSFRow.java:141) at org.apache.poi.hssf.usermodel.HSSFRow.createCell(HSSFRow.java:119) at net.sf.jasperreports.engine.export.JRXlsExporter.setCell(JRXlsExporter.java:344) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:711) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:613) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:299)
  4. Hi. As far as I know, using the specific exporter (say JRPdfExporter) will allow you to have more control on the exporting process. For example, you can add metadata information such as author, creator, etc. to the output PDF file (not sure if this can be done via JasperExportManager). JasperExportManager is for convenience (when you don't need detailed control on the output). See JasperExportManager's documentation here: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JasperExportManager.html Hope that helps.
  5. Hi Sujan, I attached the code I used to solve the problem. I hope it will be useful to you. Regards, Mark sujan Wrote: Hello Lucian, Can you please let me know in detail what I need to do. I stuck with the same problem. I have 6 subreports. 4 of them need to be printed in portrait and remaining in landscape. Can you please let me know how to do it ? Thanks in advance. Regards, -Sujan Code:public static void setPageSizeAndOrientation(JasperDesign design, ReportConfig config) { // ReportConfig, PaperInfo.Size, PaperInfo.Orientation are custom classes/enums PaperInfo.Size size = ReportBuilder.getPaperSize(config); PaperInfo.Orientation orientation = ReportBuilder.getOrientation(config); if (size == PaperInfo.Size.LEGAL) { // Size of Legal is 8.5x14 in. At 72dpi, this translates to // 8.5*72x14*72 = 612x1008. if (orientation == PaperInfo.Orientation.LANDSCAPE) { design.setPageWidth(1008); design.setPageHeight(612); } else { design.setPageWidth(612); design.setPageHeight(1008); } } else if (size == PaperInfo.Size.LETTER) { // Size of Letter is 8.5x11 in. At 72dpi, this translates to // 8.5*72x11*72 = 612x792. if (orientation == PaperInfo.Orientation.LANDSCAPE) { design.setPageWidth(792); design.setPageHeight(612); } else { design.setPageWidth(612); design.setPageHeight(792); } } else { // Default is A4. // Size of A4 is 8.27x11.69 in. At 72dpi, this translates to // 8.27*72x11.69*72 = 595x842. if (orientation == PaperInfo.Orientation.LANDSCAPE) { design.setPageWidth(842); design.setPageHeight(595); } else { design.setPageWidth(595); design.setPageHeight(842); } }}
  6. To close this one, we've deployed our application with the font extensions as advised by teodord and it looks like it's working smoothly now. Thanks, teodord. Post Edited by markrgli at 10/05/2009 07:30
  7. Thank you very much for the prompt response, teodord. We will try what you suggested and shall update this thread.
  8. Hello everyone, We are using JasperReports (3.1.4) on a Tomcat server (6.0.20) running on a Linux machine (Debian Lenny - Linux jp1 2.6.26-2-686 #1 SMP Sun Jun 21 04:57:38 UTC 2009 i686 GNU/Linux) and we're having problems generating reports that use TTF fonts (mostly Arial variants like Arial Narrow in bold). Text using this font are truncated, i.e. "Work Schedule Information" becomes "Work Schedule Informa." Our font files are inside the lib directory of Tomcat and they are referenced in our JRXML templates as in the example below. This problem only happens when the reports are generated from the Linux machine. We have the same Tomcat configuration (including the location of fonts) running on Windows XP and report generation works fine. Right now we are clueless as to what's happening so I hope you guys can shed some light on this one. Thank you very much. Regards, Mark Code: Post Edited by markrgli at 09/30/2009 07:44
  9. I rechecked my design file and I can't seem to find the any use for that. I'm using iReport (mainly on the design view) and I didn't notice it inserted that section into the xml. I've removed the section already, but the lines still don't show up in Firefox and IE. They show up in Google Chrome. Some of the borders on my grids however, still don't appear. This probably has more to do with how the browsers render HTML. :( As for the missing text problem, I've fixed it by modifying my report to remove overlaps between fields. Thank you andfedotov, your responses have been a great help. :)
  10. Hi andfedotov, Thanks for the insights. I tried what you suggested in #1 but it didn't work for me. Just to clarify, I removed the entire <rectangle> ... </rectangle> section. This is correct, right? Thanks for the link in #3. I will try the tips posted there. I might have to modify my design file to remove the overlaps. Mark andfedotov Wrote: 1. Delete this and you'll have no problems with lines: <rectangle> <reportElement mode="Transparent" x="0" y="0" width="356" height="20" backcolor="#FFFFFF"/> </rectangle> 2. Though, you may still experience stange behaviour cause almost all your field are overvlaping each others. Try to avoid this when you're exporting to formats other than PDF and internal JR. 3. I bet you'll find interesting this information from FAQ Post Edited by andfedotov at 12/05/2009 11:21 PM Post Edited by andfedotov at 12/05/2009 11:21 PM
  11. Thanks for the response, guys. Attached are my JRXML files (zipped). The main report (EmpDetails.jrxml) is composed of several subreports (EmpDetails_*.jrxml). They just have to be on the same directory. Kindly replace the SUBREPORT_DIR parameter in EmpDetails.jrxml. <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["D:\\workspaces\\Payroll\\com.sbiz.payroll.sv\\WebContent\\WEB-INF\\reports\\"]]></defaultValueExpression> </parameter> Thanks a lot guys. Hope you can shed light.
  12. Hi guys, I have some reports that need to be exported into different outputs. Exporting to PDF and RTF work fine but when exporting to HTML, some text and line elements do not appear. I checked the source code of the HTML outputs and the text are not there. I'm clueless as to what's causing the problem. Im exporting them from my code running in a web server. Attached are screenshots of the exports showing one without the problems (sample_ok.png) and one with the problems (sample_ng.png). sample_ok.png is from iReport's preview but I get the same output when exporting to PDF or RTF. sample_ng.png is the actual HTML export, as viewed in Firefox. I also included a snippet of my code for exporting to HTML. I hope you guys can shed some light into this. Thank you in advance. Regards, Mark Code:-------------------------------------------------JRAbstractExporter exporter = new JRHtmlExporter();response.setContentType("text/html");exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, false);exporter.setParameter(JRHtmlExporterParameter.SIZE_UNIT, JRHtmlExporterParameter.SIZE_UNIT_POINT); exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);// Set the output streamByteArrayOutputStream baos = new ByteArrayOutputStream();exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);exporter.exportReport();// Set the content-lengthbyte[] reportAsBytes = baos.toByteArray();response.setContentLength(reportAsBytes.length);if (filename != null) { filename = filename.trim(); if (!filename.isEmpty()) response.setHeader("Content-Disposition", "inline; filename=" + filename);}// Write to the response's output streamOutputStream os = response.getOutputStream();os.write(reportAsBytes, 0, reportAsBytes.length);os.flush();os.close();-------------------------------------------------
  13. I've found the solution. :) Hope it will be of any help to others. Code:JasperDesign design = // load designJRBand band = design.getDetail();// "banner" is the key of the image "placeholder" in my design fileJRElement elem = band == null ? null : band.getElementByKey("banner");if (elem instanceof JRDesignImage) { JRDesignImage img = (JRDesignImage) elem; JRDesignExpression expr = new JRDesignExpression(); expr.setText("\"D:/images/sample.jpg\""); expr.setValueClass(String.class); expr.setValueClassName(String.class.getName()); img.setExpression(expr);}
  14. Hi guys, Is it possible to set the image path/data of a report (from a .jrxml file) at runtime? I have these JRXML files that have image placeholders (there are image elements in the design file but the expressions are not set) and I need to set the path/data of the image from my code after I load the design file. Is this possible? Attached is the code I tried but apparently it didn't work. Any ideas? Thank you in advance. Mark Code:JasperDesign design = JRXmlLoader.load(jasperFile); JRElement elem = design.getDetail().getElementByKey("banner");if (elem instanceof JRDesignImage) { JRDesignImage img = (JRDesignImage) elem; // Tried debugging and confirmed that this line is called. img.setExpression(new JRDesignExpression() { private static final long serialVersionUID = 1L; @Override public String getText() { return "D:\\images\\sample.jpg"; } @Override public Class getValueClass() { return String.class; } @Override public String getValueClassName() { return String.class.getName(); } });}
  15. Hi Lucian, I did what you suggested and it worked. Thanks a lot. One headache down. Best regards, Mark
×
×
  • Create New...