Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Infinite Loop / Endless Page Creation with RB 19.04 on XE Seattle

Good Morning,

I'm having problems with one of our reports and was hoping to get some suggestions as to how to go about fixing it.

The problem:

When I run the report, the report loops / keeps creating page one again numerous times. The dataset has a couple of thousand records in it, so it should generate 20 or so pages, but it keeps generating hundreds all with the same information on it. (Repeats from the start).

- If I build the project in Delphi XE2 with Reportbuilder 19.04 b146 it works fine.

- if I build the same project in Delphi XE10 Seattle with Reportbuilder 19.04 b146 it loops infinitely. Same code, same version/build of Reportbuilder.

- This problem occurs in the IDE as well as on clients PC's. (It was a client who initially reported it).





Report Design

The report is a simple single band (main detail band) report linked to a ppDBPipeline which is in turn linked to a dataset. The report has one group in it, a header, footer and summary band.

The dataset on the report has no persistent fields.



What I have tried so far

- Deleted the group bands, and removed the header, footer and summary bands.

- Deleted all fields within the report except for one (so I can see if it's still repeating the same information which it does).

- Autostop property is set to FALSE (which I believe it should be for datasets). Setting it to TRUE prints one record only and stops.

- Confirmed that the report is linked to the ppDBPipeline

- Changed the height of the detail band

- Changed the visible bands from dynamic to static height and back again.

- Checked any methods on the unit to see if it's setting anything on the report dynamically

- I've searched the .DFM for ReprintOnOverflow and can't find any settings there.

- Checked the source code of my unit to see if there are any dataset.first, etc that may cause the query to change back to the first record. (none found)

- Increased the margins on the report from 0.25 to 0.5

- I have even put a new tppReport component on the form and started from scratch - the only development done was linking it to the tppDBPipeline and placing a single TppDBLabel on the detail band - and the problem still occurs.

It only appears to occur for this one unit / report that we have observed so far.

I'm running out of ideas on what else to look for and was hoping that there's something obvious that I have missed.

Thanks & Regards

Adam.

Comments

  • I've traced the problem through to Line 3507 in ppEngine.pas which reads:

    aDataPipeline.GotoBookmark(aRec.FBookmark);

    It seems to be a bookmark issue as when this is called it goes back to the first record in the dataset.

    If I comment this out, it appears to work better (although not perfect) as it repeats the last record on the page as the first record on the next page.

    I don't know if this means that the issue is with the dataset component (which it very well may be) as opposed to reportbuilder. The problem is that I can't change the dataset component if it is.

    Is there a way I can avoid Reportbuilder using bookmarks?

    If not, is there a way I can manually traverse the data myself instead of using the tppdbpipeline in the dataset to try and overcome this?
  • Hi Adam,

    Which database and connectivity are you using to access your data?

    ReportBuilder requires the use of bookmarks and a bi-directional traversal capable DB in order to properly navigate and print a report.

    The fact that your application functions correctly with XE2 but fails with 10 Seattle leads me to believe that this is an issue with the connectivity or DB components you are using. The ReportBuilder code base for these two versions of Delphi is identical.


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hi Nico,

    Thanks for your reply.

    I'm using the open source TXQuery component as the end source for the data, and connecting to it using the TppDBPipeline component.

    Is it possible for me to manually traverse the data instead of reportbuilder doing it, so I can take away the necessity for the bookmarks?

    Thanks & Regards

    Adam.
  • Hi Adam,
    Is it possible for me to manually traverse the data instead of reportbuilder doing it, so I can take away the necessity for the bookmarks?
    No, the report engine requires bookmarks to generate the report. It is not possible to manually traverse the data. This is a requirement that has been in place since the beginning.

    It appears that TXQuery is broken for the version of Delphi you are using. Looking at the Git repository, it mostly hasn't been updated in over 6 years. I suggest considering using an up-to-date TDataSet descendent such as FireDAC.




    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hi Nico,

    Thanks for your response. Unfortunately at the moment I'm using a unique feature of TXQuery for some of these reports to provide a type of pivot operation that I have been unable to find a suitable replacement for todate.

    But since I know it's not possible to manually retrieve the data from a dataset and that I have to use tppDBPipeline I'll stop trying to find a solution in that area and will attempt a different workaround.

    (I may try to copy the data across to a memory dataset such as TdxMemData and then have reportbuilder run the report from there until I can find a more efficient solution).

    There is a different GIT Repository that was only updated 3 months ago too - but it appears as though this issue hasn't been addressed.

    https://github.com/ccy/txquery

    I had a quick look at the source myself - but because Getbookmark goes straight to the native TDataset source I couldn't figure out what could be done to resolve it. (Unfortunately not an area I'm familiar with)

    Have a great day and thanks again for your help!

    Adam.
Sign In or Register to comment.