hi, what exactly is the difference between Traversal and DataPipelineTraversal in the timing dialog box of TppVariables? i do not quite follow here... tia, marc
OnTraversal should fire when the report engine moves to the next record forwards in the dataset. A traversal is defined as the first movement to a valid record position. Subsequent movements to the same record position (which are usually caused by group breaks) do not cause the OnTraversal event to fire again. This means that OnTraversal will fire ten times if ten records are traversed.
OnDataPipelineTraversal will fire everytime the record position changes in the dataset. The OnDataPipelineTraversal will fire more often because of group actions. The report engine uses bookmarks. If a detial band can't fit on a page, and must be pritined on the next page, then the current page is finished. I believe the record position moves to the next record as it always does, but then when the next page starts it moves to the previous record to print the detail band that didn't fit on the last page. There are a couple of 'event tracker' demos in the main reports demo project in which you can see which events are firing.
Jim, so when calculating the sum of a field in a TppVariable i should use Traversal as timing right so it is possible to have different result between Traversal and DataPipeLineTraversal also, DataPipeLineTraversal cannot be used to summing the value of a field is this right? thx marc
If you don't have any groups in the report, you may not see a difference. It is recommended to use the OnTraversal timing. We may take OnDataPipelineTraversal out in order to reduce confusion on this, and I don't think it is ever advantageous to have it when using for a variable's timing.
Jim, whoeps then i have a lot of work tonight i used the DataPipelineTraversal as THE timing method for all my variables in the reports i made so far... so i defenately have to change this it only came to my attention creating my last report i think it may be wise to indeed eliminate this option, i can't see what purpose it has... thx marc
Jim, i changed the timing from datapipeline to Traversal and the calculations now are incorrect, they only reflect the last value of the last detail printed (when calculated in the group footer) so when i'm calculating in the group footer wich timing do i need to use this is really getting confusing for me... tia, marc
jim, i should clarify: i'm totalling in the group header values from detailbands wich are in a subreport (child) what is the best way to archieve this ? the child report has a dataset of its own so it is NOT the last record that gets added to the total but the first how can i solve this nicely? tia, marc
Jim, i found the topic on calculating a value in a subreport and printing it in the groupfooter of the main report problem is that for this to work you need to define the oncalc event handels is code and not in RAP i tried to reference this in rap without success, is this possible or not my approach was to put the timing of the var in the group footer of the main report to DataPipelineTraversal and the calccomponent to the dataset of the child subreport this does work! BUT can i trust (in all cases) that this behaviour will ALWAYS give me the exact sum of the fields i want to sum (in the group footer of the main report) OR do i have to do the trick of adding the var of the group footer in an oncalc event of a var in a child subreport i would really appreciate if you could really clear this up for me ps: i didn't capitalize certain words to reflect a 'shoutin' behavior, it was just to make things a bit clearer, so excuse me if this bothers you... tia marc
The scope is setup in RAP so that this it may seem like it isn't possible, because RAP was implemented such that is won't have any naming conflicts beteen the ppVariable1 in one subreport from the ppVariable1 in another subreport or in the main report.
Ok, you have a subreport variable calculation in RAP, which you need to show in the main report. In RAP, you'll need to create a global handle to make this happen. You can either create a global variable in RAP that holds a reference to the variable in the main report in the OnGlobalCreate event, or create a global function that returns the handle to the variable in the main report. In the OnCalc of the variable inside the subreport, you can also update the value of the variable in the main report using this global handle.
If you don't want to show the subreport variable, remember that you can set it to Visible = False and its OnCalc will still fire and give you the calculation that you need.
You can't trust the OnDataPipelineTraversal, but you should trust the OnTraversal.
True, the OnDataPipelineTraversal is able to work, as your report is configured right now. However, if you later decide to change the report around so that there is more KeepTogether action in the detail band, then you may see the OnDataPipelineTraversal fire more often. It should also work with OnTraversal, as this event is guaranteed to fire only once, when the OnDataPipelineTraversal isn't.
Jim, thx, i'll play around with the two approches and see wich one best suits me... thanks for this explanation and possible loss of hair when the totals wouldn't be correct in the release version cu marc
Comments
forwards in the dataset. A traversal is defined as the first movement to a
valid record position. Subsequent movements to the same record position
(which are usually caused by group breaks) do not cause the OnTraversal
event to fire again. This means that OnTraversal will fire ten times if ten
records are traversed.
OnDataPipelineTraversal will fire everytime the record position changes in
the dataset. The OnDataPipelineTraversal will fire more often because of
group actions. The report engine uses bookmarks. If a detial band can't fit
on a page, and must be pritined on the next page, then the current page is
finished. I believe the record position moves to the next record as it
always does, but then when the next page starts it moves to the previous
record to print the detail band that didn't fit on the last page. There are
a couple of 'event tracker' demos in the main reports demo project in which
you can see which events are firing.
The net-net is that you should use OnTraversal
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
so when calculating the sum of a field in a TppVariable
i should use Traversal as timing right
so it is possible to have different result between Traversal and
DataPipeLineTraversal
also, DataPipeLineTraversal cannot be used to summing the value of a field
is this right?
thx
marc
It is recommended to use the OnTraversal timing. We may take
OnDataPipelineTraversal out in order to reduce confusion on this, and I
don't think it is ever advantageous to have it when using for a variable's
timing.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
whoeps
then i have a lot of work tonight
i used the DataPipelineTraversal as THE timing method for all my variables
in the reports i made so far...
so i defenately have to change this
it only came to my attention creating my last report
i think it may be wise to indeed eliminate this option, i can't see what
purpose it has...
thx
marc
i changed the timing from datapipeline to Traversal and the calculations now
are incorrect,
they only reflect the last value of the last detail printed (when calculated
in the group footer)
so when i'm calculating in the group footer wich timing do i need to use
this is really getting confusing for me...
tia,
marc
i should clarify:
i'm totalling in the group header values from detailbands wich are in a
subreport (child)
what is the best way to archieve this ?
the child report has a dataset of its own
so it is NOT the last record that gets added to the total but the first
how can i solve this nicely?
tia,
marc
i found the topic on calculating a value in a subreport and printing it in
the groupfooter of the main report
problem is that for this to work you need to define the oncalc event handels
is code and not in RAP
i tried to reference this in rap without success,
is this possible or not
my approach was to put the timing of the var in the group footer of the main
report to
DataPipelineTraversal and the calccomponent to the dataset of the child
subreport
this does work! BUT can i trust (in all cases) that this behaviour will
ALWAYS give me the exact sum of the fields i want to sum (in the group
footer of the main report)
OR do i have to do the trick of adding the var of the group footer in an
oncalc event of a var in a child subreport
i would really appreciate if you could really clear this up for me
ps: i didn't capitalize certain words to reflect a 'shoutin' behavior, it
was just to make things a bit clearer, so excuse me if this bothers you...
tia
marc
because RAP was implemented such that is won't have any naming conflicts
beteen the ppVariable1 in one subreport from the ppVariable1 in another
subreport or in the main report.
Ok, you have a subreport variable calculation in RAP, which you need to show
in the main report. In RAP, you'll need to create a global handle to make
this happen. You can either create a global variable in RAP that holds a
reference to the variable in the main report in the OnGlobalCreate event, or
create a global function that returns the handle to the variable in the main
report. In the OnCalc of the variable inside the subreport, you can also
update the value of the variable in the main report using this global
handle.
If you don't want to show the subreport variable, remember that you can set
it to Visible = False and its OnCalc will still fire and give you the
calculation that you need.
You can't trust the OnDataPipelineTraversal, but you should trust the
OnTraversal.
True, the OnDataPipelineTraversal is able to work, as your report is
configured right now. However, if you later decide to change the report
around so that there is more KeepTogether action in the detail band, then
you may see the OnDataPipelineTraversal fire more often. It should also
work with OnTraversal, as this event is guaranteed to fire only once, when
the OnDataPipelineTraversal isn't.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
thx,
i'll play around with the two approches
and see wich one best suits me...
thanks for this explanation and possible loss of hair when the totals
wouldn't be correct in the release version
cu
marc