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)
Set parameter default from SQL query
petr.mensk
Is there a way how to set parameter default value from SQL query?I have a report which takes parameters with id, fromDate and toDate. And I would like to have fromDate parameter default value obtained from database (it should be date of creation of the object with id from the first parameter). So any hints how to do this?Thanks a lot
Find more posts tagged with
Comments
bgbaird
Hey, here is one way to do this.
In the attached design, I have three dataSets:
customer: (builds param selection choices)
payments: (get the last payment date for the selected customer)
orders: (return orders where orderdate < last payment date)
Element 127 is a dummy element to force "payment" to execute.
Element 129 displays the startDate param after it has been assigned.
In the onFetch section of "payment", I set startDate parameter to the last payment date.
In the beforeOpen section of "orders", I apply both the customer and startDate param to the dataset.
It might be ugly, but it works.
Brian
petr.mensk
Thanks for reply, it really works. But there is one more thing - I also would like to show the date to user in a form and allow him to change it's value. So how can I access the formular with parameters and change the value of some field?