christina ku

Greenhorn
+ Follow
since Jan 06, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by christina ku

It's simply because the iReport version 0.4.0 is not compatible with jasperreport version 0.6.2.

So i change back to using jasperreport version 0.6.1 instead. I think it's something to do with the jasper file generated by ireport which cannot be opened by jasperreport 0.6.2.

Just an idea though i am not so sure about that. Good by me as long as it works..

chris
Hi there,

i am connecting to Mysql database in order to retrieve data. what if i have 1 million records in the DB. how does jasperviewer deal with this? does it retrieve all at once or retrieve page by page according to user selection of the next button. i noe crystal report supports paging so that each time the user click go to next page, it is going to retireve the data from the database.

Does JasperViewer support paging-on-demand? coz if it doesn't, my computer is going to run out of memory if i retrieve extremely large records. And can you suggest any methods to get around the paging problem if JasperViewer doesn't support it? Any ideas or suggestion is greatly appreciated.

regards,
Chris
ok.. solve that already.. Thanks for the advice.
what does it means by serialVersionUID ? how can i resolve it? is it something wrong with my jasper file that i created using ireport? for your info, i am using ireport 0.4.0 with jasper 0.6.2.

please advice.
chris
okie.. i paste that in the catch clause for JRException and this is wat it gives me. Brace yourself.. :

java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBaseReport; local class incompatible: stream classdesc serialVersionUID = 601, local class serialVersionUID = 602
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:233)
at my.com.shinyang.eply.ui.panels.ReportOptionsPanel.display(ReportOptionsPanel.java:757)
at my.com.shinyang.eply.ui.panels.ReportOptionsPanel$2.widgetSelected(ReportOptionsPanel.java:223)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
at my.com.shinyang.ui.MainWindow.run(MainWindow.java:28)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:704)
at org.eclipse.core.launcher.Main.main(Main.java:688)

NESTED BY :
java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBaseReport; local class incompatible: stream classdesc serialVersionUID = 601, local class serialVersionUID = 602
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:233)
at my.com.shinyang.eply.ui.panels.ReportOptionsPanel.display(ReportOptionsPanel.java:757)
at my.com.shinyang.eply.ui.panels.ReportOptionsPanel$2.widgetSelected(ReportOptionsPanel.java:223)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
at my.com.shinyang.ui.MainWindow.run(MainWindow.java:28)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:704)
at org.eclipse.core.launcher.Main.main(Main.java:688)

NESTED BY :
net.sf.jasperreports.engine.JRException: Error loading object from InputStream
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:237)
at my.com.shinyang.eply.ui.panels.ReportOptionsPanel.display(ReportOptionsPanel.java:757)
at my.com.shinyang.eply.ui.panels.ReportOptionsPanel$2.widgetSelected(ReportOptionsPanel.java:223)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
at my.com.shinyang.ui.MainWindow.run(MainWindow.java:28)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:704)
at org.eclipse.core.launcher.Main.main(Main.java:688)
Caused by: java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBaseReport; local class incompatible: stream classdesc serialVersionUID = 601, local class serialVersionUID = 602
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:233)
... 22 more

help....!!
Aee.. well... that's it all that it prints out from my code inside the catch statement.
Doesn't help much does it? How come i could not load the .jasper file? i search the net and almost all people got along well with the same code i have.

any advice? or suggestion?

chris
Hi there...

i am currently experimentating with ireport and jasper report... i have the following code:

public void display()
{
FileInputStream file = new FileInputStream("D:\\reports_jasper\\JASPER\\report1.jasper");
System.out.println("loading report.. file read "+file.available());

JasperReport jasperReport = (JasperReport) JRLoader.loadObject(file);
System.out.println("Successfully created jasper report");

java.sql.Connection con=null;

try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql://localhost/eply",
"user", "123");

if(!con.isClosed())
System.out.println("Successfully connected to MySQL server using TCP/IP...");
}
catch(Exception e)
{
System.out.println("Exception: "+ e);
}

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,null,con);

JasperViewer.viewReport(jasperPrint,false);
}
catch(Exception e)
{
System.out.println("There is exception here"+ e);
}
}

When i run my code, it gives me an error like below:
loading report.. file read 14143
There is exception herenet.sf.jasperreports.engine.JRException: Error loading object from InputStream

It will never print successfully created jasper report.. so i guess it has to do with my loading of the jasper report file.

i use ireport to create my report and it compile the report1.jrxml into report1.jasper. i dun understand the error. i included the jasperreports-0.6.2.jar into my library which i run under eclipse. is there any other things that i miss out?

chris
Hi there

i just want to ask whether the jasperviewer has the same functionality as the crystal report's paging?

When jasperviewer retrieves data from the database, does it retrieves all data or just retrieves it page by page? What if i got millions of data? does it still retrieve all? if so, it is really going to be troublesome. my comp could hang because of that. just wondering though..

pliz advice.. thanxxx
chris