faxi05
08/20/2023, 10:37 AM// handler
function generateReport( event, rc, prc ){
prc.dataForReport = getSurveyDataForReport();
var filename = getReportFilename();
var result = event.renderData(data=view( layout="pdf", view="feedback/turnier" ), isBinary=true, contenttype="application/pdf", type="pdf", pdfArgs={ filename=filename } );
fileWrite(filename, result.getRenderData().data); // <-- this line gets never executed
}David Belanger
08/21/2023, 1:08 PMfileWrite() never gets executed because the event.renderData() returns the data to the browser and ends the function.
I think what you may be looking for is event.sendFile() and be sure to add the .noRender() portion to the end of it so the browser doesn't try to render the file directly.
Make sure this call is the last call in your controller function as it will also end the function just like renderData() does.faxi05
08/22/2023, 9:56 AMrenderData() so far has been that it will happily provide data without passing it directly to the browser (at least we have used it that way and now encountered the issue mentioned above where it works as you are describing it for PDFs).
Anyway, the workaround does what we need, so all is well. Thanks again!