Jump to content
JasperReports Library 7.0 is now available ×

problem with previewer


Recommended Posts

By: T.Gopalakrishnan - gopal03

problem with previewer

2003-09-17 05:41

Hai

i am using the following code to call the report from my java program.the previewer opens but mouse clicks are not working.i can able to call the print dialog and page movement using the keyboard but not with mouse.can any one help to solve this

import java.sql.*;

import java.util.*;

import javax.swing.*;

import java.io.*;

import dori.jasper.engine.*;

import dori.jasper.view.*;

 

public class TempReport

{

 

public TempReport(String reportPath){

try{

 

// To load the .jasper file:

JasperReport template = JasperManager.loadReport(new FileInputStream(reportPath));

 

// To fill the report, first you need an instance of JRDataSource and a Map (possibly empty) of any params you use. Then:

HashMap mapa = new HashMap();

mapa.put( "Parameter1", p1 );

JasperPrint report = JasperManager.fillReport(template, mapa, oconnection);

 

//To show the reoprt, create a JRViewer and stick it in a dialog:

 

JRViewer jrv = new JRViewer(report);

JDialog viewer = new JDialog();

viewer.setTitle("Viewer");

viewer.getContentPane().add(jrv);

viewer.pack();

viewer.show();

 

}catch(Exception ex){

ex.printStackTrace();

}

 

}

 

}

Thanks

Gopal

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...