Author |
Message |
Doolhoff
Newbie
Joined: 14 Nov 2016
Online Status: Offline
Posts: 22
|
Topic: Wrong data set showing until last page? Posted: 21 Dec 2016 at 8:24am |
So my boss came to me this morning and handed me a print out of a report. He showed me a circled portion on each page that he said we needed fixed.
So what is happening:
I have a formula:
if {wi_route.wi-r-p-printf} and {wi_route.wi-r-p-printr} = yes Then
"Two Side Printed"
Else
If {wi_route.wi-r-p-printf} = yes Then
"Surface Print"
Else "Reverse Print"
With this formula I should only get one result showing consistently on all pages. However, I am getting one result on the first 2 or 3 then the correct result on the final page. Can anyone help me to understand this?
Please and thank you in advance.
If you need more info, just let me know
Edited by Doolhoff - 21 Dec 2016 at 8:25am
|
IP Logged |
|
kevlray
Admin Group
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
|
Posted: 21 Dec 2016 at 10:25am |
I am assuming that
{wi_route.wi-r-p-printf} and {wi_route.wi-r-p-printr} are Boolean otherwise your if statements would fail. To be consistent you probably should have the first statement as if {wi_route.wi-r-p-printf} = yes and {wi_route.wi-r-p-printr} = yes Then
So I am assuming for any data set that you are using for the report, the values for {wi_route.wi-r-p-printf} and {wi_route.wi-r-p-printr} never change.
If the above statement is true, then the same value should always be returned from the formula. If {wi_route.wi-r-p-printf} and {wi_route.wi-r-p-printr}ever change in a data set, then the result of the if statement would be based on what values {wi_route.wi-r-p-printf} and {wi_route.wi-r-p-printr}have when the formula is executed.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 21 Dec 2016 at 10:56am |
and to follow up on Kevlray's post, if you are placing your formula in a pager header or page footer it will show the formula result for the data in the first or last row on that page ... as an example of 'when the formula is executed"
Edited by DBlank - 21 Dec 2016 at 10:57am
|
IP Logged |
|
Doolhoff
Newbie
Joined: 14 Nov 2016
Online Status: Offline
Posts: 22
|
Posted: 05 Jan 2017 at 5:54am |
OK, all that makes sense. So here is my follow up question then.
I have it in the header so it is executing based on the subreports/data on the specified page. Is there a way to force it to always look to one location or to make it only show on the final page?
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 05 Jan 2017 at 5:58am |
Consider using a MIN or MAX value for all the records in the report (or possible a group min/max).
I don't know how the data is set and what you want it to do if it is 'mixed' values across the data set.
|
IP Logged |
|
Doolhoff
Newbie
Joined: 14 Nov 2016
Online Status: Offline
Posts: 22
|
Posted: 05 Jan 2017 at 6:11am |
So that would essentially be me telling it to search for only the highest and lowest values and only reporting on those values? That is, if I understand MIN/MAX properly.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 05 Jan 2017 at 6:57am |
That might be one solution but it is hard to to know as I don't know what you want it to print when your data set has different values row to row.
Given the formula you were using to decide between your 3 text results ("Two Side Printed", "Surface Print", "Reverse Print") what should it do if the first row meets the 'two-sided' the second row meets 'surface' the third back to two-sided' the forth row is 'reverse', etc.
Are you grouping data that should always return the same value? Are you only concerned with the first row?
Are you concerned with some sort of aggregate, meaning that all rows must have {wi_route.wi-r-p-printf}='yes' then your condition is met?
|
IP Logged |
|
Doolhoff
Newbie
Joined: 14 Nov 2016
Online Status: Offline
Posts: 22
|
Posted: 05 Jan 2017 at 8:39am |
Yes, I am grouping data that (if it was entered correctly into the database) will have the same value. The issue I am getting is it pulls all the right information but by it being in the header it only gives the correct result on the final page. The first few pages will always return with "Reverse Print" as those pages don't have the proper data in them.
So I am hoping for one of 2 solutions. Either I find a way to suppress it until the final page with the correct result. Or I get all pages to say the correct result.
Sorry if that didn't answer your question...
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 05 Jan 2017 at 8:41am |
I am assume you are starting a new page after or before a group change?
|
IP Logged |
|
Doolhoff
Newbie
Joined: 14 Nov 2016
Online Status: Offline
Posts: 22
|
Posted: 05 Jan 2017 at 8:43am |
I'm not sure, I am editing a report someone else created. What would be the easiest way to find that?
|
IP Logged |
|
|