You need to sign in to do that
Don't have an account?
Invoking a parameterized report from VisualForce page
I have spent all morning trying to get this to work, including looking at dozens of Google and SFDC posts.
I have a report that I want to be able to provide a date as a parameter for, and I want the user to be able to choose the date.
I created a (my first) VisualForce page to do this, after experimenting with many examples. If you
have looked at DatePicker, you will know that there are issues with using a native datepicker for
a custom object field.
I was able to find an example that uses JQuery's datepicker, and that part of the page works fine.
The problem I am having is that I want the VF page to have a button that invokes the report, passing
the date as the parameter.
The URL for the report looks like this, and I can manually change the date and watch it work correctly:
https://instance.salesforce.com/00Oo0000002qAb9?pv0=%2711/1/2014%27
In my VF page, the user data ends up in an input field named 'reportEndDate'. I have tried to put this
into the action field of an apex commandButton (inside an apex form) as follows:
<apex:commandButton value="Run Report" action="/00Oo0000002qAb9?p0={$reportEndDate}" />
This URL *does* go to my report page, but does not pass the date correctly.
I have tried every permutation of ways to get the output in the correct format, but after at least
5 hours of trying figured I would post this question.
I can post more of the code if necessary, but figured I would start here.
How can I get the output from the text field 'reportEndDate' to be the correct URL
for my report to work?
Thanks,
Mitch
Hi, I know that the question is quite old. But recently I had the same issue as yours. Here is the link that helped me.
http://www.tgerm.com/2011/04/passing-params-to-reports-salesforce.html