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)
setDisplayValue does not work on Birt Report Viewer
ttessitore
I am using a java class to manipulate the format for a date. The setDisplayValue code works fine in preview mode, but it does nothing when viewing via the BIRT Report Viewer. The code is:
c = new Packages.com.reports.miscellaneous.DateLocalization();
if (this.getRowData().getExpressionValue(2) != null)
{
incidentdate = c.getFormattedDate(this.getRowData().getExpressionValue(2),params["defaultdateformat"],params["shortdateformat"],params["shorttimeformat"]);
this.setDisplayValue(incidentdate);
}
I know that incidentdate has the correct value in it. I inserted this code in the OnCreate event. What is an alternative to setDisplayValue? I need to use the java class because we have unusual date requirements.
Thanks,
Tom
Find more posts tagged with
Comments
fwhorton
I have had problems with using javascript and getting it work in report design vs report viewer. The workaround for me was to use set the javascript on the dataset instead of on the table.
Also, isnt it reportContext.setParameterDisplayText(), reportContext.setParameterDisplayText() instead of this?
ttessitore
The field in question is a value in a table that was retrieved from a dataset.It is not a parameter so I don't think reportContext.setParameterDisplayText will work. Does anybody know why setDisplayValue works in Preview mode but does not work in the Report Viewer?
I will try to set the javascript in the dataset. Do you have any examples on how you did this?
fwhorton
<blockquote class='ipsBlockquote' data-author="'ttessitore'" data-cid="68331" data-time="1284125019" data-date="10 September 2010 - 06:23 AM"><p>
The field in question is a value in a table that was retrieved from a dataset.It is not a parameter so I don't think reportContext.setParameterDisplayText will work. Does anybody know why setDisplayValue works in Preview mode but does not work in the Report Viewer?<br />
I will try to set the javascript in the dataset. Do you have any examples on how you did this?<br /></p></blockquote>
<br />
can you set the value into a global variable (reportContext.setGlobalVariable()) and then use the global variable for displaying?<br />
<br />
in the report designer: on dataset click script, i usually use onRender or onCreate. set your global variable. then in the table, create a new data binding that gets the global variable or use a dynamic text. probably use a data binding since you might apply formatting.