+ Start a Discussion

Calling a report from an s-control

I am using an s-control to create an advanced customizable search function. To display the results I call a predefined report. I use it as /02030304020?pv0=SOMESTRING where I have one filter set to a string. This seem to work ok.
Now if I have a boolean filter such as /02030304020?pv0=SOMESTRING&pv1=True, then this brings the report "Select Criteria" page where the entry on the boolean filter says 'Error: Use "False" or "True" '. In the actual field you can see "True" as it is expected. If I don't do anything and simply click the Run Report the report runs ok.
I don't want the user to have to click Run Report but I just want the report to run. Like I said, if there are no booleans it seems to run without the need to click on Run Report but if there is a boolean then it won't let me go directyly to the report due to the error.
Anybody has a solution for this problem? Thanks.
I've done this a couple times & I downloaded the Firefox developer's plugin to make things easier:

When you run the report with the correct params, right click on the screen, select "Web Developer" then "Forms" then "View Form Information"  You'll see a list of all of the params that were passed into that page.  The ones you want to worry about are the pc,pn, and pv values... These are the values set in the criteria. 

When creating the links in your s-control you'll set these parameters in the href & when the report comes up, it will have those criteria filtered.  Here are a couple examples of URLs I built that launch a custom report with variable criteria:

In Case:
<a href='https://na2.salesforce.com/00O400000013LQY—format=tt&run=Run%20Report&sdate="+formatDate(startDate)+"&edate="+formatDate(endDate)+"' target='_blank'>

<a href='https://na2.salesforce.com/00O400000013LQY–format=tt&run=Run%20Report&pc1=00N30000000k9G4&pn1=eq&pv1="+divisionArray[b]+"' target='_blank'>


For Opportunities/Events/Tasks:
https://na1.salesforce.com/00O300000011vH4—&type=t&colDt_q=Custom&sd="+addDay(fridayArray[dateRange+1])+"&ed="+(fridayArray[dateRange].getMonth()+1)+"/"+fridayArray[dateRange].getDate()+"/"+fridayArray[dateRange].getFullYear()+"&pc0=ASSIGNED&pn0=eq&pv0="+replaceName(userArray[a][1])+" "+replaceName(userArray[a][2])+"&pc1=TASK_TYPE&pn1=eq&pv1=Outbound Call&pc2=00N30000000fWIL&pn2=in&pv2=*Schedule Penetration Appointment&pc3=00N30000000ru88&pn3=eq&pv3=Spoke to Decision Maker,Spoke to High Influencer"


Anyway, hope that at least helps a little bit.  Getting the Firefox Developer's plugin helps a ton with this.

Thanks for the suggestion. For some reason, if you pass a boolean variable to your report (i.e. pv0=True) it doesn't like it even though the value is correct. A work around for me was to create formula fields that equal the boolean variable. This way when I called the report and the text filter is set to True works fine.

The web developer tool is quite useful. Thanks again.

Sure, no problem.  For booleans, use 1 for true and 0 for false. "pv=1" for true and "pv=0" for false


Message Edited by zach on 08-23-2006 07:36 AM

Always ThinkinAlways Thinkin
Thomas Tobin placed a great article about building Custom Links to Custom Reports in the Reporting and Dashboards Blog along with links to two custom links in AppExchange.  And he styled it in homage to Justin Timberlake's SNL video, ==> in a [].


Message Edited by Always Thinkin on 02-15-2007 11:36 AM