Jump to content
We've recently updated our Privacy Statement, available here ×

Viewing a pre-filled report


2005 IR Help

Recommended Posts

By: weckamc - weckamc

Viewing a pre-filled report

2004-10-29 01:35

Hi!

 

I am writing an application which uses JasperReports. It consists of a report selector, a viewer, an exporter.

 

While compiling is going to be done by i-reports, all other report related tasks (like filling, exporting...) is handled by a class called reportmanager.

 

When a user selects a report it will be loaded and filled. Then the viewer opens. From there the user has possibilities for printing and exporting.

 

Now to my problem:

I am not able to copy with loading the filled report (jrprint file) into the viewer...I am getting only JRexceptions.

 

Here is my code (there are redundant lines because I tried several ways):

 

 

 

Options.setSourceFile("H:\jasper\reports\jrprint\" + myfilepart + ".jrprint");

File myprintsource = new File (Options.getSourceFile());

//JasperPrint myprintfile = (JasperPrint) JRLoader.loadObject(new FileInputStream(myprintfile));

//JasperPrint myprintfile = (JasperPrint) JRLoader.loadObject(myprintsource);

JasperPrint myprintfile = JasperManager.loadPrint(new FileInputStream(myprintsource));

try {

if (myprintfile != null)

JasperViewer.viewReport(myprintfile, false);

}

catch (Exception e) {

System.out.println("An error occured while loading the report!");

}

 

//JRViewer jrv = new JRViewer(myprintfile);

//getContentPane().add(jrv);

 

 

 

 

By: weckamc - weckamc

Help please

2004-11-01 21:39

Nobody got a hint?

 

 

 

 

By: weckamc - weckamc

RE: Viewing a pre-filled report

2004-11-03 00:13

Very poor result :(

 

 

 

 

By: C-Box - c-box

RE: Viewing a pre-filled report

2004-11-03 00:28

Perhaps you should post the exception that's fired... so somebody could take a look on it. Just with your posting it's hard to figure out what's going wrong.

 

Perhaps your filled reports are compiled and filled with Jasper 0.6.0 and your viewer is already 0.6.1 ????

 

C-Box

 

 

 

 

 

 

By: weckamc - weckamc

RE: Viewing a pre-filled report

2004-11-03 00:45

I recently found it :-)

 

I forgot to handle a possible (!) JRException in my code...

 

Sometimes the solution is too easy to find it ;)

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...