Using client date time input for the start end date for a report

How do I implement a perspective page for a report to use the date range from a date time input component to set the start and end dates for the report?

tutorial video says to import as a parameter.
I see report data parameters, I can assign a parameter to something.

However, I don’t know how to set my date input to be that thing.
I also don’t know how that would work if two people tried to look at my report with two different ranges at the same time.

I am trying to figure it out from
Reports in Perspective Sessions - Report Visualization (inductiveuniversity.com)

okay I kind of got it

I made a new param in the report
then in perspective I added report viewer component
then I added a parameter that was the same name
then I bound the parameter in component to the value of my tag picker in the flex container prop above

I hope that makes sense. I have not yet checked to see if the range of the report works when two users use it though.


when I set the parameter to the start date and another to the end date to dynamically change the date ranges of the report, it get’s angry and says the report is not reading data right on the gateway, throws an error, and in perspective says not a valid report

I can get it to calm down, and shows me the value as a string

not sure what to do to fix this

Yes the parameters you’ve created would work differently for each user. Try opening a session twice one in browser and one in same browser with incognito mode and observe this.

Could you elaborate what happens what you say it gets angry?
One of the possibility I think might be happening is, since you’re setting startDate first this makes startDate>endDate hence it won’t be getting data for given range.

oh thank you, I will try setting the end date first next run through

I did set them defaults

I thought maybe the data type was wrong

I don’t know if to point at value or formatted value. Will test more tomorrow.

You can use formatted value there and also what’s is the input you’re giving?

Is it only the Date or is it Date&time?

If I use formatted, I see the date and time
just value, seems like no time, only date

The errors from yesterday are gone.
I don’t know why. I have the parameters set to value instead of formatted value.

Still, the data does not seem to be right.
I have a historized tag in the report.
I change the dates.
The dates show at the top.
The data is not a total.

On report data:
I have parameters Start and End.
These are set as the State Date Binding and End Date Binding.

On perspective report viewer component:
I have the parameters Start and End bound to the datetimeinput components

The data seems to just show the current value of the tag instead of totaled value over the range

What kind of data source is your report using?

I am testing a tag history right now

the tag is counting hours up to 8, and resetting

I have set the aggregation mode to many different modes

You may need to use a tag calculation query:
https://docs.inductiveautomation.com/display/DOC81/Tag+Calculation+Query

yah
Just tried that and it worked

thanks

Trying to troubleshoot these values
So I added a table
Can’t get the table to show up though.
image

using my date selector as the start and end, I get 40 or 66 for the total of my hours tag, and I am not sure why or how it does that

so if I can get this table to show up, I think I can troubleshoot that

Also having issues with my tag calcs
when I add some tags to the query, it doesn’t allow me to see them in the design section for a long time. Then finally, no idea what it was waiting on, will finally be available.


go the table to show up
I guess if you drag a table on, it starts with object detail which is nothing

but if you drop the data on the page, it creates a table that will propagate data

If you aren’t seeing any results in preview mode, its most likely the default values for your start and end parameters.

As to not seeing your tags from the query, you may need to save first.

I got it working kind of
object details is nothing basically

image

image

i just created a report with some made up data, i think this is like what you are looking?



image

2 Likes