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

ktrinad

Members
  • Posts

    1,134
  • 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 ktrinad

  1. By: daniel schulken - danielschulken add ability to pass print service 2003-12-31 06:51 Sorry about the formatting. This allows for a printservice to be specified to print to. I really wasnt sure where else to send this. added to JasperPrintManager.java public static boolean printReport( PrintService printService, JasperPrint jasperPrint, boolean withPrintDialog ) throws JRException { return printPages( printService, jasperPrint, 0, jasperPrint.getPages().size() - 1, withPrintDialog ); } public static boolean printPages( PrintService printService, JasperPrint jasperPrint, int firstPageIndex, int lastPageIndex, boolean withPrintDialog ) throws JRException { return JRPrinterAWT.printPages( printService, jasperPrint, firstPageIndex, lastPageIndex, withPrintDialog ); } added to JRPrinterAWT.java public static boolean printPages( PrintService printService, JasperPrint jrPrint, int firstPageIndex, int lastPageIndex, boolean withPrintDialog ) throws JRException { JRPrinterAWT printer = new JRPrinterAWT(jrPrint); return printer.printPages( printService, firstPageIndex, lastPageIndex, withPrintDialog ); } private boolean printPages( PrintService printService, int firstPageIndex, int lastPageIndex, boolean withPrintDialog ) throws JRException { boolean isOK = true; if (firstPageIndex < 0 || firstPageIndex > lastPageIndex || lastPageIndex > jasperPrint.getPages().size()) { throw new JRException( "Invalid page index range : " + firstPageIndex + " - " + lastPageIndex + " of " + jasperPrint.getPages().size() ); } pageOffset = firstPageIndex; PrinterJob printJob = PrinterJob.getPrinterJob(); PageFormat pageFormat = printJob.defaultPage(); Paper paper = pageFormat.getPaper(); switch (jasperPrint.getOrientation()) { case JRReport.ORIENTATION_LANDSCAPE : { pageFormat.setOrientation(PageFormat.LANDSCAPE); paper.setSize(jasperPrint.getPageHeight(), jasperPrint.getPageWidth()); paper.setImageableArea( 0, 0, jasperPrint.getPageHeight(), jasperPrint.getPageWidth() ); break; } case JRReport.ORIENTATION_PORTRAIT : default : { pageFormat.setOrientation(PageFormat.PORTRAIT); paper.setSize(jasperPrint.getPageWidth(), jasperPrint.getPageHeight()); paper.setImageableArea( 0, 0, jasperPrint.getPageWidth(), jasperPrint.getPageHeight() ); } } pageFormat.setPaper(paper); Book book = new Book(); book.append(this, pageFormat, lastPageIndex - firstPageIndex + 1); printJob.setPageable(book); try { printJob.setPrintService(printService); if (withPrintDialog) { if (printJob.printDialog()) { printJob.print(); } else { isOK = false; } } else { printJob.print(); } } catch (Exception ex) { throw new JRException("Error printing report.", ex); } return isOK; } By: Umberto Uderzo - uuderzo RE: add ability to pass print service 2004-01-05 02:07 Hi Daniel. you can specify a print service using somethign similar to this one: PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet(); printServiceAttributeSet.add( new PrinterName( "printer service name" , null )); JRPrintServiceExporter exporter = new JRPrintServiceExporter(); exporter.setParameter( JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, printServiceAttributeSet); exporter.setParameter( JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE); exporter.setParameter( JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.FALSE); exporter.exportReport(); You will need to set also the stream to be exported.
  2. By: Umberto Uderzo - uuderzo Printer Service lookup during report export 2004-01-05 01:45 Hi all! I'm building a framework around JasperReport and I managed to store all the PrintRequestAttributes in my data structures before launching Jasper. So I can pass the parameters directly to Jasper through the exporter.setParameter( JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, printRequestAttributeSet) method of the JRPrintServiceExporter class without calling the Printer dialog. I noticed that if I send a non void parameters set I get an exception that tells me that there is no suitable printer found. I looked to the exporter sources and noticed that in the lookup phase the algorithm uses both PrintServiceAttributes and PrintRequestAttributes. But The latter are PrinterJob attributes, and are not useful for the service lookup. So I managed to send only the PrintServiceAttributes for the lookup, and to send the PrintRequestAttributes to the job. It worked perfectly. I suppose this might be corrected in the official sources. What do you think about? Thanks in advance... Umberto
  3. By: silvano - silvan0 How to set PDF attributes ? 2003-05-14 07:31 When exporting a report in PDF format which is best way to set some PDF attributes, such as encryption or metadata, using iText APIs? By: Teodor Danciu - teodord RE: How to set PDF attributes ? 2003-05-17 05:39 Hi, You can modify the PDF exporter or create one of your own if you want to add new functionality such as encryption and metadata. You use iText directly for this. Thank you, Teodor By: silvano - silvan0 RE: How to set PDF attributes ? 2003-05-18 23:03 Thank you for you suggestion. I modified the PDF exporter for changing PDF settings and it works fine! Silvano By: Teodor Danciu - teodord RE: How to set PDF attributes ? 2004-01-04 09:27 Hi, The PDF encryption functionality is now available in the CVS repository version. There is also a "pdfencrypt" sample provided. Thank you, Teodor
  4. By: Mohan Joshi - mohanjoshi1 pdf Encryption 2003-02-25 02:29 Is there any way I can encrypt the generated report ? By: Teodor Danciu - teodord RE: pdf Encryption 2004-01-04 09:26 Hi, The PDF encryption functionality is now available in the CVS repository version. There is also a "pdfencrypt" sample provided. Thank you, Teodor
  5. By: Raj - rajs1 Dynamic image width/ height 2004-01-04 08:12 Has anyone attempted to (either in the xml or programatically) specify the width/height of an image at "fill time". I would like the users to be able to load images of different size (with a max limit place on it, of course). I would like to specify the width/height parameters depending on the size of the image when the jasper file gets filled (at run time). Any experience at attempting this would be much appreciated. Cheers -raj
  6. By: pandu - pandu16 The page number is null on the first page 2003-10-13 14:29 I am working on subreports, i have created 4 groups and placed the subreports in those groups. I used the page footer to include textfeild with the "Page " + String.valueOf( $V{PAGE_NUMBER} ) + " of " evaluation time is "now". The page number is null on the first page, but in the subsequent pages it prints the page number. Can anyone suggest why on the first page the page number is null? Appericate you help. Thanks Pandu By: Franco Weichel - franco_weichel RE: The page number is null on the first page 2003-12-18 02:23 My workaround for that.. ($V{PAGE_NUMBER} == null ? "1":$V{PAGE_NUMBER}.toString()) Franco By: Teodor Danciu - teodord RE: The page number is null on the first page 2003-12-13 11:07 Hi, I think this happens only when the first detail band does not fit on the first page and forces a page break. (If it occurs inside a subreport, it is about the first page of the subreport) Can you confirm me that this "Page null of N" problem appears only when the first detail band does not fit on the first page? Thank you, Teodor By: Arun Kumar M - arunkumarm RE: The page number is null on the first page 2004-01-02 01:42 Hi teodord, I am also facing same problem and teodord you are right this happens only when first detail band does not fit on the first page. A fix or work around for this will be helpful to me. Thanks, Arun By: Teodor Danciu - teodord RE: The page number is null on the first page 2004-01-03 14:29 Hi, The fix is already available in the CVS repository at sourceforge.net. Thank you, Teodor
  7. By: meul - meul Comments in xml report files 2004-01-03 10:15 Hi I want to inserts comments on xmlReportsFiles but jasperEdit removes them automaticely (comment like <!-- myComment --> ) How can i do? Thanks
  8. By: Tullio Bettinazzi - tullio0106 Is Jasper still developed ? 2004-01-02 09:07 I didn't see any change in last 6 months. Is Jasper still improuved ? Tks Tullio By: Vinod Kumar Singh - vinodsingh RE: Is Jasper still developed ? 2004-01-03 02:46 Where did you see? Look at the forum discussion and CVS, you will find improvements. Vinod
  9. By: kaeyann - cvc Help about the sample ! 2001-11-17 22:46 I download the jasperreports-0.2.0.sample.zip and already set the classpath whit D:apjavaJasperReports 0.2.0jasperreports.jar;D:apjavaJasperReports 0.2.0commons-digester.jar;D:apjavaJasperReports 0.2.0commons-beanutils.jar;D:apjavaJasperReports 0.2.0commons-collections.jar and also modify the JasperReportsTestApp.java's JDBC parameter to fit my envirement , but when I run "java -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser JasperReportsTestApp -Tfill -FFirstJasper.jasper" , I got a exception " java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]?L?Ī??ԭz????ަnbsp; at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.SQLGetDataStringDate(Unknown Source) at sun.jdbc.odbc.JdbcOdbcResultSet.getDataStringDate(Unknown Source) at sun.jdbc.odbc.JdbcOdbcResultSet.getDate(Unknown Source) at sun.jdbc.odbc.JdbcOdbcResultSet.getDate(Unknown Source) at dori.jasper.engine.JRResultSetDataSource.next(JRResultSetDataSource.j ava:140) at dori.jasper.engine.JRVerticalFiller.fillReport(JRVerticalFiller.java: 57) at dori.jasper.engine.JRFiller.fillReport(JRFiller.java:84) at dori.jasper.engine.JasperManager.fillReport(JasperManager.java:383) at dori.jasper.engine.JasperManager.fillReportToFile(JasperManager.java: 361) at dori.jasper.engine.JasperManager.fillReportToFile(JasperManager.java: 310) at JasperReportsTestApp.main(JasperReportsTestApp.java:60) " Can someone tell me where was wrong ? thanks By: kaeyann - cvc RE: Help about the sample ! 2001-11-18 05:58 Now I know the problem and the solution is : In FirstJasper.xml , we must replace queryString with " SELECT ShippedDate,ShipCountry ,RequiredDate,CustomerID,OrderID,ShipName,ShipVia,ShipPostalCode,OrderDate,ShipCity,ShipAddress,EmployeeID,ShipRegion,Freight FROM Orders WHERE OrderID <= 12000 ORDER BY ShipCountry " , and it will ok .... But , I don't know why we need to do this ? Why we must select columns in this order ?
×
×
  • Create New...