![]() |
|
|
|
#1 |
|
Hi friends while I try a sample code I found some difficulties.
The sample code is public class CrystalClient { private static final String CONNECT_STRING = "DSN=abp"; private static final String REPORT_FILE_NAME = "d:\\arp\\Report1.rpt"; private static final String SQL_QUERY = "select * from student"; private static final String PRINT_FILE = "d:\\arp\\YourNewReport.doc"; public static void main(String args[]) throws Exception{ try { crystal.CrystalReport report = new crystal.CrystalReport(); //report.aboutBox(); // Lets see if it was loaded properly report.setConnect(CONNECT_STRING); report.setReportFileName(REPORT_FILE_NAME); report.setSQLQuery(SQL_QUERY); report.setPrinterCopies((short) 1); report.setPrinterCollation(crystal.PrinterCollatio nConstants.crptDefault); report.setDestination(crystal.DestinationConstants .crptToFile); report.setPrintFileName(PRINT_FILE); report.setPrintFileType(crystal.PrintFileTypeConst ants.crptWinWord); // Change output type if necessary report.printReport(); } catch(Exception e) { System.out.println(e); e.printStackTrace(); } finally { com.linar.jintegra.Cleaner.releaseAll(); } } } The output of the execution is .... java.lang.NullPointerException at crystal.CrystalReport.printReport(CrystalReport.ja va:4482) java.lang.NullPointerException at javaapplication10.CrystalClient.main(CrystalClient .java:42) BUILD SUCCESSFUL (total time: 0 seconds) How can I overcome this. arputharaj |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| exception has been thrown by the target of an invocation | mintcremes | General Help Related Topics | 0 | 07-03-2008 02:51 AM |
| java.net.SocketException: Broken pipe exception at HttpServletRequest | sadasivar | Software | 0 | 03-11-2008 04:40 AM |
| exception unknown software exception error - Excel.exe | mfinamore | Software | 0 | 11-15-2007 04:54 PM |
| Exception in thread "main" java.lang.NoClassDefFoundError: | prakash.nmsp@gmail.com | Software | 0 | 06-29-2007 10:03 AM |
| Help on PrincipalPermission Demand Throwing Exception | Abba Biya | MCTS | 1 | 02-07-2007 10:05 PM |