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)
Adding a grid dynamically based on dataset
Vijay Sai
Hi All,
I have a situation where I need to add a grid to the report based on the no of columns returned by the dataset. The no of columns returned by dataset in varying as result from stored procedure is built (temp table is created and returned as result).
I tried event Handlers in Java extending the DatasetEventAdapter and adding grid on onFetch method. The code runs fine but the report displayed does not contain the added grid.
anyone guiding on getting this done would be a great help.
Thanks in advance.
Find more posts tagged with
Comments
mwilliams
I think you'd have to add the grid by the beforeFactory method. Is there no way that you know how many columns that the stored procedure will return? No parameter that the stored procedure uses can tell you this?
Vijay Sai
No , there is no way to get the no of columns returned as the temp table which is the result is built on fly in the Stored Procedure.
I used onFetch DataSetEventHandler which has reportContext has a parameter. I used that context to add the grid but of no use.
mwilliams
Your best bet is probably going to be to write a connection to your database in the beforeFactory method to determine your columns that will be returned, then build your report from scratch based on those results.