/**
* @see no.ugland.utransprod.util.Threadable#doWork(java.lang.Object[],
* javax.swing.JLabel)
*/
public Object doWork(Object[] params, JLabel labelInfo) {
Deviation deviation = ((DeviationModel) presentationModel.getBean())
.getObject();
if (deviation != null) {
labelInfo.setText("Genererer utskrift...");
ReportViewer reportViewer = new ReportViewer("Avvik",
mailConfig);
JDialog dialog = Util.getDialog(owner, "Avvik", true);
WindowInterface window = new JDialogAdapter(dialog);
window.add(reportViewer.buildPanel(window));
try {
List<Deviation> list = new ArrayList<Deviation>();
list.add(deviation);
reportViewer.generateProtransReportFromBean(list, "Avvik",
ReportEnum.DEVIATION, null, "Avvik "
+ deviation.getDeviationId() + "_"
+ Util.getCurrentDateAsDateTimeString()
+ ".pdf");
window.pack();
window.setSize(new Dimension(850, 700));
Util.locateOnScreenCenter(window);