Rendering pdf I get following exception when calling run and render separately:
org.eclipse.birt.report.engine.util.ResourceLocatorWrapper findResource
Using runAndRender() images are displayed correctly:
task = engine.createRunAndRenderTask(report);
IPDFRenderOption options= new PDFRenderOption();
options.setOutputFormat(format.toString());
options.setSupportedImageFormats("JPG;PNG;BMP;SVG;GIF");
options.setOutputStream(output);
task.setRenderOption(options);
task.run();
But I had to call call run and render separately, oherwise pagenumbers aren't calculated correctly.
So I changed my code:
runTask = engine.createRunTask(report);
rptdocument = (File.createTempFile("birt", ".rptdocument")).getCanonicalPath();
runTask.run(rptdocument);
IReportDocument rptdoc = engine.openReportDocument(rptdocument);
renderTask = engine.createRenderTask(rptdoc);
IPDFRenderOption options= new PDFRenderOption();
options.setOutputFormat(format.toString());
options.setSupportedImageFormats("JPG;PNG;BMP;SVG;GIF");
options.setOutputStream(output);
renderTask.setRenderOption(options);
renderTask.render();
Now the pagenumbers are calculated correclty. By my image isnt't displayed. I get the above exception.
I put an image in the masterpage in a rptlibrary. The image file is an "image file in shared resources" (a jpg in the same directory as the rptlibrary).
I also tried an own IResourceLocator - this resourcelocator is called correctly when rptlibrary is searched, but there's no call for my image.
Setting an imagehandler (options.setImageHandler(myownimagehandler)) has no effect - none of the methods are called.
What shall I do?
Any suggestions?