当前位置: 动力学知识库 > 问答 > 编程问答 >

BIRT: displayText is null for &_format=pdf

问题描述:

I'm trying to generate a PDF of a parameter by passing in the parameters using the BIRT URL naming convention.

https://pmapps.fiscal.treasury.gov/PFC-BIRT/frameset?__report=BusinessDayReport_Quarterly.rptdesign&Quarter=14&To_Date=2015&__format=pdf

I have two parameters: Quarter and To_Date.

I'm using params["Quarter"].displayText and params["To_Date"].displayTextin a Dynamic Text report item in the actual report. When I generate the report through a URL, both values are replaced with null. When I use the BIRT popup I see the displayText.

I've tried changing the format of the output to .doc and still the displayText isn't shown.

Is there a way I can output to a PDF while passing the parameters through a URL and see the displayText?

网友答案:

Apparently, this is a known bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=305319#c2

So, I created a Report Variable: Quarter Text, and placed the following code in the beforeFactory script of my report:

if (params["Quarter"].value == 13) {
    vars["Quarter Text"] = "First Quarter"; 
} else if (params["Quarter"].value == 14) {
    vars["Quarter Text"] = "Second Quarter";
} else if (params["Quarter"].value == 15) {
    vars["Quarter Text"] = "Third Quarter";
} else if (params["Quarter"].value == 16) {
    vars["Quarter Text"] = "Fourth Quarter";
} else {
    vars["Quarter Text"] = "Unknown Quarter"; 
}

It's a simple workaround.

分享给朋友:
您可能感兴趣的文章:
随机阅读: