Jump to content
Changes to the Jaspersoft community edition download ×

sundarperiannan

Members
  • Posts

    5
  • Joined

  • Last visited

sundarperiannan's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi friends, I want to display sub report data in two times. How can i done this. Please help me. Thanks advance..
  2. Hi friends i am using dot matrix printer to print jasper report through java. In my report has 10 pages, if i get print out first 3 pages are correctly printed but the next pages are not correctly printed, ie next page first line may be the last line of previous page. Pleasse help me.
  3. Hi friends, I amusing jasper report for reporting my application. If I call .jrxml file the report successfully added in my application but .jasper file could not be loaded. I download some sample code from one website that code also not working. Please help me. This is the sample code. Code:import javax.swing.*;import java.awt.*;import java.sql.*;import java.util.*;import java.io.*; import net.sf.jasperreports.engine.*;import net.sf.jasperreports.engine.design.*;import net.sf.jasperreports.view.*; public class ReportViewer extends JFrame{ public ReportViewer(String fileName){this(fileName,null);} public ReportViewer(String fileName,HashMap parameter){super("View Report");try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Connection con = DriverManager.getConnection("jdbc:odbc:udtsteelshop"); JasperPrint print = JasperFillManager.fillReport(fileName, parameter, con); JRViewer viewer=new JRViewer(print); Container c=getContentPane();c.add(viewer);}catch(ClassNotFoundException cnfe){cnfe.printStackTrace();}catch(SQLException sqle){sqle.printStackTrace();}catch(JRException jre){jre.printStackTrace();} setBounds(10,10,600,500);setDefaultCloseOperation(DISPOSE_ON_CLOSE); } public static void main(String args[]){ HashMap param=new HashMap(); param.put("FromDate", "2009-07-22");param.put("ToDate", "2009-07-25");ReportViewer viewer=new ReportViewer("C:\\Documents and Settings\\TAINNTECH\\My Documents\\NetBeansProjects\\UdtSteelShop\\Reports\\PurchaseList.jasper",param);viewer.setVisible(true);}}The exception is,Exception in thread "main" java.lang.NullPointerException at net.sf.jasperreports.engine.JRPropertiesMap.readObject(JRPropertiesMap.java:185) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:88) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:232) at udumalai.MyiReportViewer.<init>(MyiReportViewer.java:66) at udumalai.MyiReportViewer.main(MyiReportViewer.java:92)Java Result: 1
  4. Hi friend, I am also try this, but the sub report not displayed.
  5. Hi Friends, I am using jasper reports for my java desktop application. In my application i could not show the sub reports. Null pointer exception will be displayed. Please help its very urgent. This is Code Code: Map<String, String> params = new HashMap<String, String>(); params.put("FromDate", strFromDate); params.put("ToDate", strToDate); params.put("GroupCode", strGrpCode); params.put("SubReport", "C:\\Documents and Settings\\TAINNTECH\\My Documents\\NetBeansProjects\\UdtSteelShop\\Reports\\SalesAndPayment1_subreport1.jasper"); //params.put("SubReport", "C:\\Documents and Settings\\Nagendran\\My Documents\\NetBeansProjects\\UdtSteelShop\\Reports\\SalesAndPayment_SubReportItems.jasper"); { //FileInputStream fileRpt = null; try { //fileRpt = new FileInputStream("C:\\Documents and Settings\\Nagendran\\My Documents\\NetBeansProjects\\UdtSteelShop\\Reports\\SalesAndPayment.jasper"); //jasperReport = (JasperReport) JRLoader.loadObject(fileRpt); //jasperPrint = JasperFillManager.fillReport(compiledFileName, params, conLocal); jasperDesign = JasperManager.loadXmlDesign("./Reports/SalesAndPayment1.jrxml"); jasperReport = JasperManager.compileReport(jasperDesign); jasperPrint = JasperFillManager.fillReport(jasperReport, params, conLocal); jasperPrint.setPageWidth(600); intViewerFlag++; if (intViewerFlag > 1) { viewer.clear(); } viewer = new JRViewer(jasperPrint); viewer.setVisible(true); viewer.setEnabled(true); viewer.setSize(dpSalesAndPayment.getSize()); viewer.setBackground(Color.WHITE); dpSalesAndPayment.setLayout(new BorderLayout()); dpSalesAndPayment.add(viewer, BorderLayout.CENTER); dpSalesAndPayment.setBackground(Color.WHITE); } catch (JRException e) { e.printStackTrace(); System.out.println(e); JOptionPane.showMessageDialog(null, e); } }In jrxml file the following code i use;<subreport><reportElement x="1" y="18" width="345" height="21"/> <subreportExpression class="java.lang.String"><![CDATA[$P{SubReport}]]></subreportExpression></subreport>
×
×
  • Create New...