Questions and answers on developing, deploying and using plugins and JavaBeans
by jasantana » Mon May 12, 2014 10:23 pm
I'm trying to write the content of an jrxml file and then print it but I get an error because the files is not being written. I get a false using writeFileToReportsDir() method.
Any clue?
- Code: Select all
var _fileName = 'nephosReport' + application.getUUID().toString() + '.jrxml';
application.output(_reportSourceXML)
var _jsFile = plugins.file.createFile(_jsFile);
application.output(plugins.jasperPluginRMI.writeFileToReportsDir(_fileName, _reportSourceXML));
plugins.jasperPluginRMI.runReport(foundset, _fileName, true, plugins.jasperPluginRMI.OUTPUT_FORMAT.VIEW, null);
- ServoyForum0001.png (54.25 KiB) Viewed 2726 times
Best regards,
Juan Antonio Santana Medina
jasantana@nephos-solutions.co.ukServoy MVP 2015Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
-
jasantana
-
- Posts: 555
- Joined: Tue Aug 10, 2010 11:40 am
- Location: Leeds - West Yorkshire - United Kingdom
by Thomas Parry » Tue May 13, 2014 5:43 pm
-
Thomas Parry
-
- Posts: 498
- Joined: Thu Jan 10, 2008 8:48 pm
- Location: Ottawa, Canada
by jasantana » Fri May 16, 2014 11:29 am
I manage to get my goal:
- Code: Select all
function onCmdCreateJasperAction(event) {
var _reportSourceXML = scopes.JasperGenerator.createReportFromForm('testList'); //elements.tabSections.getTabFormNameAt(1));
if (_reportSourceXML) {
var _jasperDirectory = plugins.UserManager.Server().getSettingsProperty('directory.jasper.report');
if (_jasperDirectory) {
var _reportName = 'nephosReport' + application.getUUID().toString() + '.jrxml';
var _fileName = plugins.file.getHomeFolder() + '/' + _reportName;
var _jsFile = plugins.file.createFile(_fileName);
if (plugins.file.writeTXTFile(_jsFile, _reportSourceXML)) {
if (plugins.UserManager.copyFileToServer(_jsFile.getAbsolutePath(), _jasperDirectory, true)) {
plugins.jasperPluginRMI.viewerTitle = 'Questioner Manager Viewer';
plugins.jasperPluginRMI.runReport('questioner_manager', _reportName, true, plugins.jasperPluginRMI.OUTPUT_FORMAT.VIEW, null);
// Delete server file
var _serverFile = plugins.file.convertToJSFile(_jasperDirectory + '/' + _reportName);
if (_serverFile) {
plugins.file.deleteFile(_serverFile);
}
}
}
// Delete client file
plugins.file.deleteFile(_fileName);
}
}
}
Best regards,
Juan Antonio Santana Medina
jasantana@nephos-solutions.co.ukServoy MVP 2015Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
-
jasantana
-
- Posts: 555
- Joined: Tue Aug 10, 2010 11:40 am
- Location: Leeds - West Yorkshire - United Kingdom
Return to Plugins and Beans
Who is online
Users browsing this forum: No registered users and 13 guests