I am hoping that someone ran into this and solved it. Basically I have built a report that builds datasets and tables dynamically in the "beforeFactory" event. Report renders fine until I tried to add a hyperlink to the cells of a column.
I can easily add a static hyperlink using something like:
var cellData1 = elementFactory.newDataItem( null );
var ac = StructureFactory.createAction();
var ah = cellData1.setAction(ac);
ah.setLinkType(DesignChoiceConstants.ACTION_LINK_TYPE_HYPERLINK);
ah.setTargetWindow("_blank");
ah.setURI("'
http://www.myweb.com");
But what I need is something like:
ah.setURI("'
http://www.myweb.com?q=" + row["someothercolumn"]);
The row["someothercolumn"] represents a value returned by the dataset. If I had been using the GUI I would have accessed the Hyperlink property of the data element and build an expression like that.
I cannot find anywhere in the api doc how to build an expression that concatenates strings and dataset column values in a way that setURI can use it. The issue is that setURI takes a string and when I am binding my cell to the dataset I am dealing with objects. I cannot see anywhere in the api how to build expressions similar to the GUI that I can use as hyperlinks.
Any help would be appreciated.
I wonder whether I am running into a bug. When I do this:
ah.setURI(""
http://www.myweb.com?q=" + row["someothercolumn"]");
It does interpret the expression but the url is always interpreted as: "
http://www.myweb.com?q=null"
If it recognizes the expression and evaluates it, row["someothercolumn"] should not be null. I will try to set something using the classicar models db to illustrate this.