Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java Viewer shows and exports, but doesn't print

Status
Not open for further replies.

Rorbac

Programmer
Jul 15, 2002
13
LU
The following AbstractAction opens a report in JDialog. The correct data is shown, but I can't print the report. I can export the report to .pdf and then print it, but that's not how I expect it to work. Previewing it on the crystal server works as well as selecting the complete URL and calling it directly in a browser. No problems with another report that's called by another AbstractAction that's a copy from this one, except for the report name. (P.S. I replaced the usernames and passwords in this post with *)

Did anyone have the same problem and how can I fix it?

public AbstractAction printrel1 = new AbstractAction() {
public void actionPerformed(ActionEvent e){
String reportName = null;
String s1 = ((JTextField)find("permat")).getText();
String annee = ""+((JComboBox)find("conyear")).getSelectedItem();
String deb = "Date("+annee+",1,1)";
String fin = "Date("+annee+",12,31)";
try{
reportName = " System.out.println("reportName = " + reportName);
ReportViewerBean viewer = new ReportViewerBean();
JDialog printDial = new JDialog();
viewer.start();
viewer.setReportName(reportName);
printDial.setTitle("Demande Congé");
printDial.setModal(true);
printDial.setSize(600,400);
printDial.getContentPane().add(viewer);
printDial.setVisible(true);
viewer.stop();
viewer.stopAllCommands();
viewer.stopViewer();
}
catch(Exception ex){
System.out.println("Exception: " + ex.getMessage());
ex.printStackTrace();
}
}
};
 
What OS are you running? If running Windows XP did you apply the service release?
 
Win XP and SP1.

But why would the other report run if the OS was the reason?

 
Rorbac

We are using Crystal Reports 10 and Crystal Enterprise. On computers running XP with the service pack installed everything runs fine until print time. e.g. you can view the report, export the report to other formats and even "ad hoc" and "modify" the report. However, when printing is selected a short tone is sounded and the IE window the request is made from closes. No errors are generated.

On Windows XP machines without the service release installed this does not happen.

Obviously there is a conflict between CE and machines running XP SP1.
 
Just tried it on a Win 2000 Pro PC and that's even worse. No data at all is shown in my JDialog. But navigating to the report on a browser works, so it can't be a network configuration problem on that machine ....

- Rorbac
 
Rorbac:

Ah. Well it's not what I've run across then.

Hang in there. Surely someone around here has run across this too.

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top