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)
Dynamic Connection at Report Initialization Level
sgummuluru
Hello:
I have a need to connect to the database dynamically and retrieve report specific details (not report data) at the report initialize level. Have anyone done this before, using .java class or .js?
Thank you for the help!
Best,
Sudha
Find more posts tagged with
Comments
mwilliams
Is this something you have easy access to in your application outside the report that you could pass through as a parameter? Can you explain more about what you're trying to do in the initialize method and what the data is you're trying to access?
sgummuluru
Thanks for the response.
No we do not, for ad-hoc reporting we would depend on the application to send the criteria.
For the batch reporting we would have to query from the database as the criteria is updated in the database based on the certain processes. Like status. Also, report frequency is not the standard weekly or monthly frequency. These dates are have to be retrieved from the database.
Additionally this information it needs to be displayed on report tiles and footers on the Master Page. Report Initialize level or a common java/js component will retrieve this information from the database. Am I correct?
Let me know if you have any questions. Thank you for the help.
mwilliams
If the data is in your database, you should be able to just bring it in with a dataSet. You can show data from your dataSet in the masterpage. You can connect to your database in javascript, so you could do it in the initialize. I guess I just don't see what you need to have access in initialize for. Maybe I'm missing something. If you bring the data that you need into one dataSet and you need to pass it to the query in your other dataSet, you can embed a table that is bound to the second dataSet into a grid or table bound to the first dataSet, then use dataSet parameters to pass the values from the outer table to the query of the inner table. Let me know if I'm totally missing something or confused something.
sgummuluru
I thinks your suggestions on using different datasets would be sufficient for the present.
Though I thought we can't display data from dataset onto MasterPage. I tried just now. This helps. Thank you !!!
If you have an example on how to connect to database in javascript will help a great deal for the future needs.
Appreciate your help, Thank you again.
mwilliams
I think you could probably just connect to your database with a dataSet to get the data you want to use in your other dataSet, then put a hidden element at the very top of your report that is tied to this dataSet so that it is ran before any other dataSet. In the onFetch of the dataSet, you can then store the needed values into variables that you can use to build your other query in the second dataSet's beforeOpen script. This is essentially the same thing as the above except you don't have to embed the table into the other. It would be very similar to what you're proposing with the "initialize" script. Unfortunately, I don't have an example of connecting to a database with script handy to send you, but you could probably find the information you need on the web to connect to a ODBC/JDBC database with javaScript.
sgummuluru
I will give a try with your suggestion. Thank you!
mwilliams
Not a problem. Let me know if you run into any issues!