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

niik

Members
  • Posts

    15
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by niik

  1. Thanks for the suggestion. I will give that a try.
  2. As a workaround, I ended up writing the image to disk as a temporary JPG file. I can pass the file name into the report as a report parameter and use an image expression of type String to print the JPG. I can use this for right now, but would appreciate any information on a cleaner solution. Thanks.
  3. This is possible by modifying the background or foreground color of a report style after filling the report: jasperPrint = JasperFillManager.fillReport(rptfile,parameters,ds); Color userColor = new Color(R, G, B); JRStyle[] styleList = jasperPrint.getStyles(); for (int j = 0; j < styleList.length; j++) { if (styleList[j].getName().equals("tableHeader")) { styleList[j].setBackcolor(userColor); jasperPrint.addStyle(styleList[j], true); } else if (styleList[j].getName().equals("formTitle")) { styleList[j].setForecolor(userColor); jasperPrint.addStyle(styleList[j], true); } } Let me know if you have any questions.
  4. Hi all, Does anyone have experience printing an image from a report parameter of type java.awt.Image? The image prints, but the colors are distorted/inverted. These are the corresponding lines in the report: <parameter name="sigImage" isForPrompting="false" class="java.awt.Image"/> <imageExpression class="java.awt.Image"><![CDATA[$P{sigImage}]]></imageExpression> The image is generated from an encrypted signature file before filling the report and stored as a java.awt.Image in a HashMap along with other report parameters that are passed into the report: Map parameters = new HashMap(); parameters.put("sigImage",img); jasperPrint = JasperFillManager.fillReport(rptfile,parameters,ds); img is a java.awt.Image. I have tried replacing img with a JPG read from disk: same result, the image prints with inverted colors. If I export img as a file to disk from the Java program, it looks fine, even if I use the image retrieved from the HashMap. Only if I change the image expression in the report to type String and specify a file name, the image prints correctly. Any help would be appreciated, thanks in advance. Post Edited by niik at 06/29/2009 16:26
  5. I might be having the same problem. I have Jasperserver running on Windows XP. The sample reports run, but a report I created in iReport that uses a MySQL database on a different machine which runs Linux, doesn't. It seems to hang when you try to view it. Also, when I edit this report from the Jasperserver web interface, go to Data Source, and try to test the connection, it hangs. If I change the parameters to connect to the local MySQL database japserserver, it succeeds. There is no immediate log output (catalina.out or jasperserver.log) when this happens. However, when I try to shut down Jasperserver, I get the following in jasperserver.log and have to manually kill the java.exe process to shut down Tomcat: 08:39:42,669 ERROR ErrorLogger,JasperServerScheduler_QuartzSchedulerThread:2015 - An error occured while scanning for the next trigger to fire. org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.JasperServerScheduler': com.mysql.jdbc.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. [see nested exception: com.mysql.jdbc.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago.] at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:1396) at org.quartz.impl.jdbcjobstore.JobStoreCMT.acquireNextTrigger(JobStoreCMT.java:1132) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:233) * Nested Exception (Underlying Cause) --------------- com.mysql.jdbc.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1070) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2104) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:729) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:298) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:283) at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37) at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771) at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.springframework.scheduling.quartz.LocalDataSourceJobStore$2.getConnection(LocalDataSourceJobStore.java:125) at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:111) at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:1381) at org.quartz.impl.jdbcjobstore.JobStoreCMT.acquireNextTrigger(JobStoreCMT.java:1132) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:233) Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:516) at java.net.Socket.connect(Socket.java:466) at java.net.Socket.<init>(Socket.java:366) at java.net.Socket.<init>(Socket.java:208) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2027) ... 13 more Is there a setting that is preventing Tomcat from opening a JDBC connection to a different host? These are my connection parameters: Driver: com.mysql.jdbc.Driver URL: jdbc:mysql://128.1.1.11:3306/company1 I am able connect to that database from a simple Java program I run locally. Any ideas? Thanks in advance, niik
  6. Thanks for the reply. I was not referring to anything within the report. Everything there is under control. What I am referring to is the PDF file generated by JRPdfExporter. Its contents are fine - everything displays correctly. But the file header field that contains the number of pages in the PDF seems to be missing. Here is an example for a non-JR PDF header that contains the number of pages: Code: %PDF-1.3 %âãÃÓ 138 0 obj << /Linearized 1 /O 141 /H [ 923 272 ] /L 738862 /E 200185 /N 3 /T 735983 >> endobj where /N 3 seems to be the number of pages. This is the PDF header in a JR-generated PDF: Code:[code] %PDF-1.4 %âãÃÓ 4 0 obj <</Filter/FlateDecode/Type/XObject/Length 2284/BitsPerComponent 8/Height 82/ColorSpace[/indexed/DeviceRGB 255(ÿÿÿþþþýýÿýýýýýûÿüûÿüýþûúûüþúûüùùùöùùùøöøöôõ÷öõóòîóòóðïçïíðìëæéçØåääáÃÞÚÙÇÃÚ×ÓÑÌÌ̲ÒΙÌÌÆÀ½º²®pµ±«¢ž™™™f™™Â‡ƒ3™™3â„¢f I don't see any number of pages there. Am I missing something, so it isn't written into the PDF?
  7. Hi, I am currently working on a project, where you can export reports to PDF via JRPdfExporter and fax them with Hylafax. I noticed that on the cover page there is no entry for the number of pages. For other PDF's the number of pages will display there. Does anyone know why there is no entry for 'number of pages' in the PDF file's header when it is exported with JRPdfExporter? Thanks
  8. This is a solution to change a style attribute after the call to Code: jasperPrint = JasperFillManager.fillReport(rptfile, parameters, dataSource); 1. In ireports define a style that contains a default background color. Apply this style to the rectangle(s). 2. After calling fillReport(), find the style and change its background color attribute: Code:[code] if (hexVal != null && !"".equals(hexVal)) { Color userColor = new Color(R, G, B ); JRStyle[] styleList = jasperPrint.getStyles(); for (int j = 0; j < styleList.length; j++) { System.out.println("style " + j + " is " + styleList[j].getName()); if (styleList[j].getName().equals("tableHeader"«»)) { System.out.println("found tableHeader"«»); styleList[j].setBackcolor(userColor); jasperPrint.addStyle(styleList[j], true); } } } 3. Export your report. Post edited by: niik, at: 2007/08/28 15:52
  9. Does anyone know the solution to this problem? Help is appreciated.
  10. I am having the same problem: different font sizes are generated when the fields have the same properties. Please give some more details of how to solve this. Thanks in advance
  11. Had the same problem. Fixed it by adding: PrintService[] service = PrinterJob.lookupPrintServices(); for (int j = 0; j < service.length; j++) { if (service[j].getName().equals(sysPrinterName)) { printerSelected = service[j]; break; } } and passing the print service into JRPrintServiceExporter by: exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE, printerSelected); instead of: exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, printServiceAttributeSet);
  12. Thanks for the suggestion....tried it out... Jasper doesn't support overflow of a subreport in a footer band. I have to make the band a sufficient height to avoid the runtime error caused by this fact. This will cause that band to reserve space, even when it isn't displaying. The issue remains. Any other suggestions? Post edited by: niik, at: 2007/08/01 14:47
  13. Did you mean that the last page should be the only place it displays? This can be done by adding a dummy group with an empty group expression (group breaks only once). Make the group's header band height=0, and move the fields from the columnFooter to the new group's footer.
  14. Hi All, There are several posts on how to make page footers (for data that needs to display on the bottom of pages) display only on the last page or the last page of a group. However, if you use a "print when expression" to suppress the footer in certain cases (example: Invoice only sometimes displays discount phrase at the bottom of last page), jasper will still reserve space for the footer band and cause a page break, before it would be necessary with no footer band present. Is there (1) a way to keep a suppressed footer from reserving space; Or (2) a way to make a group footer display on the bottom of the page, to act like a page footer on the last page of a group? Any other ideas? Thanks
×
×
  • Create New...