We've already looked at how to create event frame based reports in RtReports,
but it's also possible to make time based reports. Let's create one. If I go to file
new I'll select a time report template and I'll call it daily report. The first thing
you need to choose is the recurrence pattern and this means once the report is released
what time periods would you be able to select to print this report from in the generator.
I want a report that I can print daily that corresponds to a 24 hour time period that
starts at 6 a.m. So my recurrence is going to be every one day with a reference start time
of 6 a.m. and has a total time of 24 hours. The recurrence pattern specifies what time periods
you're going to be able to choose from in the generator. However in the editor when you test
the report the recurrence pattern isn't going to be enforced. So here in the data template I
now have a time period. This time period here corresponds to the total time of this report,
so if I create a journal action under here the start and end time will correspond to
the whole report. Let's go ahead and create a journal action here to bring in the unit
1 pH directly from the tag. I'm going to add a new action parameter and I'm going
to use a PI tag and I'll search for unit 1 pH. I'll call this unit 1 pH and add a new results
definition for my trend and pull in the unit 1 pH and click OK . Let me go ahead and test this
out in a view test report and this is where I said the recurrence pattern isn't going
to be enforced. For a start time I'll do star minus one day and the end time will be star. So
it'll correspond to a 24 hour time period but it's not enforced to start at 6 a.m. each day.
Let's look at where this journal action shows up. Here I have journal events, terminal states,
journal entries and results and this value here is my trend. My duration is one day
and the start time is as I specified only for testing purposes not enforcing the recurrence
pattern. Let's bring this into our report if I go to format template I'm going to insert a new
section and this is the daily pH trend and let me insert some text and I'll insert my trend and
it's gonna be this right here. Go to report, view and let's refresh and there's my daily pH trend.
I would like to add a break in so we'll do that here. In addition to the pH trend that
corresponds to the entire 24-hour time period I'd like to break this time period up into
smaller chunks and time-based reports let you do that. Under time I'm gonna say insert time
based template and here I'm going to have two 12-hour intervals. To do that I go to the time
tab and under sampling interval number I'm gonna sample at periods of 12 hours. So for any 24-hour
period I should get two of these. I want to bring in the exact same journal action for the unit one
pH but broken up into two 12-hour intervals. So I'm going to copy the existing journal action
and paste it underneath this 12-hour interval section. Let's go to the journal and refresh.
We still have our existing journal event that we had before which corresponds to the 24 hour time
period but now we have this journal section here with two time-based journals. These correspond to
the two 12-hour time periods so if I open up the first one you can see that it's 12 hours long.
Let's bring these both into our report by using an iterator. If I go back to my format template
I'm going to create an entirely new section and this is going to be the 12 hour intervals and
I'm going to iterate on the entry. If I go to expressions I'm gonna pull time-based journal
over into my iterator and then I'm going to insert my two trends if I insert trend I'll go to source
and I need to go find it and here it is down at value. So I do want to make it a little bit wider,
go to report, view and refresh and you can spend some time cleaning this up but you can
see that this first section here daily pH trend corresponds to this graph here and if I go down
it's iterated through these two trends with this iterator here in my 12-hour interval section.
We know that this makes sense because of the time periods here on our trends this is 11 28
at 10:31 a.m. to 10:30 1:00 p.m. and then this is 10:28 10:31 p.m. to 10:31 a.m. on the 29th so two
12-hour time periods. Let's head on over to the generator to test out this report. I'll need to
log in and under quick links I'll select report because this is a time-based report. I know my
report name includes the word daily so let me just add that as a filter and I'll click search
and here's my daily report. I'll click it and then say proceed to context entry. Now
again because I never unselected that AF server was required I do need to choose one and I need
to widen my time frame to include the time periods of when the report can be printed.
So here's my time search results and in this time frame these are the different
times that I'm allowed to print and this is where the recurrence pattern is enforced.
The template status is in edit it hasn't been released so I can't officially print
this report so if I try and click on generate it's going to fail but I still can view the
report so if I go ahead and click view and generate report I should get a report from
November 24th at 6 a.m. to November 25th at 6 a.m. The report is currently running and when
it's completed it will open up a new window. And here's the correct 24 hour time period enforced
by the recurrence pattern and then here's the two 12-hour sections that I wanted as well.