programmatically set color of PDF output

Questions and answers for designing and implementing forms in Servoy

programmatically set color of PDF output

Postby wes.s.grayson » Thu Apr 07, 2016 6:00 pm

I use the onRender function to change the color of certain elements on my form (table view) such as "due_date". If the due_date's value is 2015, it shows as red in the table for expired. When I print this form to a PDF using the code below, none of the colors print. Does onRender only work on forms, not for output? If so, what is the best way to programmatically set the color for my report based on the values of each record? I don't have Jasper or any other reporting engine like that.

Code: Select all
//print this form
   forms.due_date_report.controller.print(false,false,plugins.pdf_output.getPDFPrinter('c:/temp/report.pdf'));
   
   //launch PDF file in Adobe Reader
   application.executeProgram('rundll32', 'url.dll,FileProtocolHandler', 'c:/temp/report.pdf');
   


thanks!
wes.s.grayson
 
Posts: 43
Joined: Mon Jan 23, 2012 5:39 pm

Return to Forms

Who is online

Users browsing this forum: No registered users and 5 guests

cron