You need to sign in to do that
Don't have an account?
Michael Dsoza
Not getting background color in PDF....
Hi...I have made one visualforce page & in that i have made one table.
I am giving different-different color to their each row by javascript & it is working fine in salesforce environment but when i render the same page as PDF then I am not getting any background color on that row ?
I need background color in PDF too.
Please tell me how can i get background color in PDF too.
THnaking you...
I found the answer in another thread
the "problem" was that I was using styles in the header
. As prescribred by grigri9 in the post linked to above, moving the styles to a static resource and referencing it like below did the trick. What a waste of 2 hours!
Hope it helps somebody,
~Tyler
All Answers
As far as i know, Javascript doesn't work when the VF page is rendered as pdf.
so use CSS to achieve your goal.
Since my table is dynamic so how can i directly attach css to my table.
I tried the following things too like...
I have called css class in javascript code as
rows[i].className = "name of my class";
but it is still working in vfpage but not in pdf.
Please give me idea abt it...
THanking you..
have you tried giving style to tables?
for individual use like this:
and for whole page use like:
Yaa Rahul, you are right from yourside but there are some more table are there which is used only for the border in my page so if I give css like as u told so that row will also get filled by background color.
Since I am geenrating dynamic table & have to different-different color in their row like
If rownumber is even then red
else
color is green
& every header must be of blue color.
Could you post small part of your code, where you are changing the colour.
It would be useful for us to help.
This is code that i made to give alternate color to my table.
Since It is working fine in Visualforce page but it is not working while rendering PDF.
I am having the same issue - have you discovered a solution?
Thank You!
Tyler
I found the answer in another thread
the "problem" was that I was using styles in the header
. As prescribred by grigri9 in the post linked to above, moving the styles to a static resource and referencing it like below did the trick. What a waste of 2 hours!
Hope it helps somebody,
~Tyler