I have a bean that I use in my Servoy solution. When I want to print the form which contains the bean (I use the “controller.showPrintPreview” method), the bean does not get printed. Only a gray rectangle appears in the place where the bean should be.
Anyone encountered this behavior? Did you find a solution to it?
You can take a snapshot, of the bean,with this function:
//Creates a (thumbnail) image from the given image/bean/form_element that fits in the given size
var thumbnail = application.createJPGImage(imageDataProvider,80,80);
plugins.file.writeFile("c:/temp/thumb.jpg", thumbnail)//Creates a (thumbnail) image from bean or other form element that fits in the given sizevar other_thumbnail = application.createJPGImage(forms.companyReports.elements.employeesChart,forms.companyReports.elements.employeesChart.getWidth(),forms.companyReports.elements.employeesChart.getHeight());
Than you can show/print that image, anywhere you want!
Hope this helps