use of com.servoy.j2db.printing.PageList in project servoy-client by Servoy.
the class SwingForm method printXML.
/**
* @see com.servoy.j2db.IFormUIInternal#printXML(boolean)
*/
public String printXML(boolean printCurrentRecordOnly) {
IApplication application = formController.getApplication();
IFoundSetInternal fs = formController.getFoundSet();
try {
// $NON-NLS-1$
application.blockGUI(Messages.getString("servoy.formPanel.status.xmlPrinting"));
if (printCurrentRecordOnly) {
fs = fs.copyCurrentRecordFoundSet();
}
FormPreviewPanel fpp = new FormPreviewPanel(application, formController, fs);
fpp.process();
StringWriter w = new StringWriter();
((PageList) fpp.getPageable()).toXML(w);
fpp.destroy();
return w.toString();
} catch (Throwable ex) {
// $NON-NLS-1$
application.reportError(Messages.getString("servoy.formPanel.error.printDocument"), ex);
} finally {
application.releaseGUI();
}
return null;
}
use of com.servoy.j2db.printing.PageList in project servoy-client by Servoy.
the class WebForm method printXML.
/**
* @see com.servoy.j2db.IFormUIInternal#printXML(boolean)
*/
public String printXML(boolean printCurrentRecordOnly) {
IApplication application = formController.getApplication();
IFoundSetInternal fs = formController.getFoundSet();
try {
if (printCurrentRecordOnly) {
fs = fs.copyCurrentRecordFoundSet();
}
FormPreviewPanel fpp = new FormPreviewPanel(application, formController, fs);
// AWT stuff happens here, so execute it in the AWT Event Thread - else exceptions can occur
// for example in JEditorPane while getting the preferred size & stuff
processFppInAWTEventQueue(fpp, application);
StringWriter w = new StringWriter();
((PageList) fpp.getPageable()).toXML(w);
fpp.destroy();
return w.toString();
} catch (Throwable ex) {
// $NON-NLS-1$
application.reportError(application.getI18NMessage("servoy.formPanel.error.printDocument"), ex);
}
return null;
}
Aggregations