Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: How To Directly Print

  1. #1

    Default How To Directly Print

    Hi Friends,

    I want my data to be printed directly without showing any dialog box.
    Means When A User Presses Print , The Print Preview, Or Printer Dialog Must Not Appear But Directly The Print Out On The Printer Must Appear.

    When I am trying this :
    Code:
    public void print(JFreeReport report) 
    	{ 
    		PrintingPlugin plugin = new PrintingPlugin(); 
    		boolean success = plugin.performExport(report); 
    		if (! success) 
    			System.out.println("Encountered a problem printing the document"); 
    	}
    It Is Showing "Null Pointer Exception"

    Currently I am using :

    Code:
    if (report != null)
    {
         try
         {
    	     ReportPane pane = new ReportPane(report);
    	     PrintExportTask directPrint = new PrintExportTask(pane, new ReportProgressDialog(),"Print" );            directPrint.run();			
         }
         catch (ReportProcessingException rpe)
         {				
          rpe.printStackTrace();
         }
    }
    But It Is Showing Printer Dialog Box.

    Thankyou.

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Hi,

    the ExportTasks are not meant to be used outside the PreviewComponents.

    There are other way to get direct printing:
    http://forums.pentaho.org/showthread.php?t=33373

    Regards,
    Thomas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.