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)
How to get values of table cell's children
kallem
Hi,
I have been trying to create a custom html emitter which extends existing html emitter. I have a report which contains a table. Most of the cells use basic data items but in some I'd like to add custom content based on data the cell data.
I have been trying to do this by adding hidden data items in the cell. I interpret parsing in my emitter using startCell(ICellContent) and then access cell's children through ICellContent.getGenerateBy. I get to extract child element properties but I didn't find any method to get value of the child. How can it be retrieved?
On the other hand the above isn't exactly the preferred way. It sounds better if I can just access data set values in specific cell but unfortunately I didn't find a way to do this. Would it be possible?
Thanks in advance,
Kalle
Find more posts tagged with
Comments
JasonW
Kalle,
Not sure if this is helpful, but you can access the data rows (bound column values) like:
try{
IBaseResultSet brs =cell.getResultSet();
QueryResults irs = (QueryResults) brs.getQueryResults();
IResultIterator ri = irs.getResultIterator( );
while ( ri.next( ) )
{
System.out.println(ri.getValue("ORDERNUMBER" ));
}
}catch(Exception e){
System.out.println("error");
}
Jason
kallem
Thanks for the tip. I did already make a workaround using hidden data elements but it's a bit clumsy. Iterating data in a way you proposed would be nice. When I tried it I noticed that it iterates all data in the data source. How can I get row data for target cell alone? ICellContent contains row index but it gives an index to the table and I didn't figure out how to convert it to data source row index.
- Kalle
JasonW
Kalle,
I do not know of a way to do this. Can you not use startData( IDataContent data ) which should be called after start cell to check the values?
Jason
kallem
Hi,
I did already use startText to interpret field values but startData seems to be a better choice. Only problem with both of these methods is that I have to add fields in the report and that was the thing I was trying to avoid. But anyway I can now get the results as needed.
- Kalle