Recent

Author Topic: Two pass report - problem with content.  (Read 1249 times)

wekwejt.com

  • New Member
  • *
  • Posts: 10
Two pass report - problem with content.
« on: May 04, 2023, 10:54:57 pm »
Hello,
I would like to use the TOTALPAGES function and I have checked "Two pass report" but the generated report is empty, only the page header is visible. If the "Two pass report" option is unchecked, everything is visible.
What am I doing wrong?

dseligo

  • Hero Member
  • *****
  • Posts: 1086
Re: Two pass report - problem with content.
« Reply #1 on: May 04, 2023, 11:57:33 pm »
How do you use dataset in your report?

I would say you use TfrUserDataset, and you don't correctly initialize your variables in OnFirst event. You have to initialize your variables there, because OnFirst event is called two times when report is 'Two-pass report'.

dseligo

  • Hero Member
  • *****
  • Posts: 1086
Re: Two pass report - problem with content.
« Reply #2 on: May 05, 2023, 12:20:23 am »
I made a small project that demonstrates problem you describe.

wekwejt.com

  • New Member
  • *
  • Posts: 10
Re: Two pass report - problem with content.
« Reply #3 on: May 07, 2023, 10:52:32 pm »
How do you use dataset in your report?

I would say you use TfrUserDataset, and you don't correctly initialize your variables in OnFirst event. You have to initialize your variables there, because OnFirst event is called two times when report is 'Two-pass report'.

I am using TBufDataset in this project.
You can see attached previews of the same data: singlePass and doublePass. Some fields from the dataset are visible in both cases, but not the rest of the data.


dseligo

  • Hero Member
  • *****
  • Posts: 1086
Re: Two pass report - problem with content.
« Reply #4 on: May 08, 2023, 02:27:00 am »
I am using TBufDataset in this project.

I expanded my example with TBufDataset ('Show report 2 ...' buttons) and couldn't reproduce your issue. I initially thought that you might turned on 'UniDirectional' option of BufDataset, but I get exception if this option is turned on.

Can you try my example and see if it is working on your end?
Do you do something different with BufDataset than I do in my example?

wekwejt.com

  • New Member
  • *
  • Posts: 10
Re: Two pass report - problem with content.
« Reply #5 on: May 10, 2023, 11:29:00 pm »
I found the source of the problem. It was the CloseDataSource property set to True in frDBDataSet1.
My fault for not checking.
Now "Two Pass Report" and thus TOTALPAGES works fine.
Thanks for the help.

 

TinyPortal © 2005-2018