Here is how I change the Virtuaizer demo to try to print directly. But it is sensible the same :( The main() is existed before the print is relly lauched by the system :( (I use linux debina with cups) CUPS is launched (there is a job icon into gnome) only when the main() is finished. Is there a way to print before ?
// ----------------------------- BEGIN ----------------------------- import java.util.HashMap; import java.util.Map; import net.sf.jasperreports.engine.JRDataSource; import net.sf.jasperreports.engine.JREmptyDataSource; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRExporterParameter; import net.sf.jasperreports.engine.JRParameter; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperPrintManager; import net.sf.jasperreports.engine.export.JRCsvExporter; import net.sf.jasperreports.engine.fill.JRFileVirtualizer; import net.sf.jasperreports.view.JasperViewer; import java.io.*; import javax.swing.*; /** * @author Teodor Danciu ([EMAIL PROTECTED]) * @version $Id: VirtualizerApp.java,v 1.8 2006/04/19 10:26:14 teodord Exp $ */ public class VirtualizerApp { /** * */ public static void main(String[] args) { final String fileName = args[0]; try { // Virtualization works only with in memory JasperPrint objects. // All the operations will first fill the report and then export // the filled object. // creating the data source final JRDataSource ds = new JREmptyDataSource(5000); // creating the virtualizer final JRFileVirtualizer virtualizer = new JRFileVirtualizer(2, "tmp"); virtualizer.cleanup(); // filling the report //JasperPrint jasperPrint = fillReport(fileName, ds, virtualizer); try{ final PipedOutputStream pos = new PipedOutputStream(); PipedInputStream pis = new PipedInputStream(pos); new Thread(){ public void run(){ try{ Map parameters = new HashMap(); parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer); JasperFillManager.fillReportToStream(new BufferedInputStream(new FileInputStream(fileName)), new BufferedOutputStream(pos), parameters, ds); pos.close(); } catch(Exception e){ System.err.println("Erreur pendant le remplissage du document : "+e); e.printStackTrace(System.err); } } }.start(); JasperPrintManager.printReport(new ProgressMonitorInputStream(null, "Impression...", new BufferedInputStream(pis)), true); pis.close(); } catch(Exception e){ System.err.println("Erreur pendant l'impression : "+e); e.printStackTrace(System.err); } } catch (Exception e) { e.printStackTrace(); System.exit(1); } } } // ----------------------------- END ------------------------------- Le vendredi 15 septembre 2006 à 02:23 -0700, Md. Mortoza Ali Khan a écrit : > Hi Yves > If you are printing directly to printer, it should work, lets see your > result. Good luck. > Mortoza > > yves pielusenet <[EMAIL PROTECTED]> wrote: > hello Mortoza, > Maybe I have to print more than 100 000 pages :c( > I'm testing the virtualizer demo with an empty datasource of > 100000.... > > Le vendredi 15 septembre 2006 à 02:07 -0700, Md. Mortoza Ali > Khan a > écrit : > > Hi Yves > > I have seen it can display few thousand pages document. What > is the > > size of your document? > > Mortoza > > > > yves pielusenet wrote: > > Hello, > > As I have a very big report to print, > > I wonder if Jasper can begin the print job before the report > > has > > finished to be generated ? > > > > thanks, > > > > -- > > yves piel > > > > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web > > services, security? > > Get stuff done quickly with pre-integrated technology to > make > > your job easier > > Download IBM WebSphere Application Server v.1.0.1 based on > > Apache Geronimo > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > jasperreports-questions mailing list > > jasperreports-questions@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/jasperreports-questions > > > > > > > > > > > ______________________________________________________________________ > > Get your own web address for just $1.99/1st yr. We'll help. > Yahoo! > > Small Business. > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web > services, security? > > Get stuff done quickly with pre-integrated technology to > make your job easier > > Download IBM WebSphere Application Server v.1.0.1 based on > Apache Geronimo > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > jasperreports-questions mailing list > jasperreports-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jasperreports-questions > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web > services, security? > Get stuff done quickly with pre-integrated technology to make > your job easier > Download IBM WebSphere Application Server v.1.0.1 based on > Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > jasperreports-questions mailing list > jasperreports-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jasperreports-questions > > > > > ______________________________________________________________________ > Stay in the know. Pulse on the new Yahoo.com. Check it out. > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ jasperreports-questions > mailing list jasperreports-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jasperreports-questions ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ jasperreports-questions mailing list jasperreports-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jasperreports-questions