Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
PDF not picking the script changes while saving but working fine in BIRT Viewer
Demolisher
Hi,
I had created a report in which I am using chart, table, cross tab. My requirement is to have the background in blue color by default but if the user choses B/W version ( added through scripting) then Background color should be white. I am able to achieve the same for chart, table. While for Cross tab, I am seeing very strange behavior, If I am viewing the report in Birt Viewer (Run ->View Report -->As PDF) then I am getting the white color in Background for crosstab. But if I try to run the report like (right click on rptdesign --> Report -->Run report ) and then export as pdf then it is not picking the script changes for cross tab.
Scripting used is
function onCreateCell( cellInst, reportContext )
{
if (reportContext.getOutputFormat() == "pdf" ){
if(reportContext.getParameterValue("RP_Color").toString() == "false"){
cellInst.getStyle().backgroundColor = "white";
cellInst.getStyle().setBackgroundColor("RGB(169,170,226)");
cellInst.getStyle().borderTopStyle = "solid";
cellInst.getStyle().borderTopWidth = "1px";
cellInst.getStyle().borderTopColor = "black";
cellInst.getStyle().borderBottomStyle = "solid";
cellInst.getStyle().borderBottomWidth = "1px";
cellInst.getStyle().borderBottomColor = "black";
cellInst.getStyle().borderLeftStyle = "solid";
cellInst.getStyle().borderLeftWidth = "1px";
cellInst.getStyle().borderLeftColor = "black";
cellInst.getStyle().borderRightStyle = "solid";
cellInst.getStyle().borderRightWidth = "1px";
cellInst.getStyle().borderRightColor = "black";
cellInst.getStyle().setBackgroundColor("BLACK");
}
}
}
Kindly respond to this.
Find more posts tagged with
Comments
mwilliams
This is because when you export to PDF, you're exporting the viewer output to PDF. So, if it's supposed to show up one way in the viewer and one way in PDF, if you run in the viewer and then export to PDF, it'll look the same. However, if you were to run it separately to PDF via a URL link in your viewer that uses the run command rather than the frameset command, it'd show up correctly. Let me know if I'm misunderstanding something, but I believe this is the reason yours isn't working on "export".