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();
}
}
};
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();
}
}
};