final JFreeReport report1 = gen.parseReport(file1);
report1.setData(myData);
setReportProperties(report1, rapName, imagePath, compName,compId);
final PreviewFrame frame1 = new PreviewFrame(report1);
frame1.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame1.pack();
RefineryUtilities.positionFrameRandomly(frame1);
frame1.setVisible(true);
frame1.requestFocus();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e.getMessage(), "Error: " + e.getClass().getName(), JOptionPane.ERROR_MESSAGE);