Ignition perspective reporting parameters

Hello,
I am adding two components to a reporting viewer in order to select the query time range. I am having trouble getting the data to pass through. I see two different areas where I can pass the parameter through.
1)


2)

I am binding my EndDate and StartDate parameter to my components. I then specify my paremeters in my sql script.:

    reason,
    SUM(downtime_duration_minutes) AS total_minutes,
    COUNT(*) AS reason_count
FROM 
    ignition.senntech_201_reporting_downtime_interval
WHERE 
    event_time >= :StartDate
    AND event_time < :EndDate
GROUP BY 
    reason
ORDER BY 
    total_minutes DESC;

If you are using a query source in the report, you don't use the regular named query place holders for parameters. You instead use a question mark

WHERE 
    event_time between ? AND ?

Thank you, do I now need to use the parameter 1 and 2 at the bottom of the report editor? Does this mean I will no longer use the parameters at the top left?

Press the braces button and select the param name you want to substitute in. Keep the parameters in the top left.

1 Like

Awesome! You have helped me very much. I couldn't find much about this in the manual.

1 Like

Also, note that the value you provide in the report for each parameter are defaults. This is so you can test the report in place. When you provide parameters, either from a report viewer or the script function, they override the default parameter values, so you don't have to leave them blank in the report.

2 Likes

Thanks, was just wondering.