Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 11 total
Thread DBISAM Dataset.Next never reaches Dataset.EOF (with using QuickReport)
Tue, Jun 2 2020 3:23 AMPermanent Link

Ron van Kempen

Microloon bv

In our Delphi 10.3 application we create PDF documents  a Quickreport using DBISAM tables. (by eDocEngine rendering)

While debugging I can see that in procedure procedure TQRController.Execute; in line 2033 of the attached QuickRpt.pas file the Dataset.Next;  statement never sets FDataset.Eof to True.  This results in an endless loop.
(I can also see that a DataSet.Prior; is not done, so that is okay.)

What can cause DBISAM never reaching Eof while performing infinite Next  commands?
(Generally or specific in this situation)



Attachments: QuickRpt.pas
Tue, Jun 2 2020 6:21 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ron


First point - please do not post other peoples code on a public site.

I can only talk generally, but as far as I am aware the only things that will stop Eof being reached is a Move, Prior or First command, or possibly a filter being set / unset. In the years I used DBISAM the only thing that ever stopped Eof was me missing the Next command in a loop Frown

Roy Lambert
Tue, Jun 2 2020 10:00 AMPermanent Link

Ron van Kempen

Microloon bv

Hi Ron, Thank you for your answer.

Further debugging tells me that the Next statement is not working at all.
The loop remains processing the first record.
So my general question is now: What can prevent a Next statement to get  to the next record?

Roy Lambert wrote:

Ron


First point - please do not post other peoples code on a public site.

I can only talk generally, but as far as I am aware the only things that will stop Eof being reached is a Move, Prior or First command, or possibly a filter being set / unset. In the years I used DBISAM the only thing that ever stopped Eof was me missing the Next command in a loop Frown

Roy Lambert
Tue, Jun 2 2020 10:04 AMPermanent Link

Ron van Kempen

Microloon bv

> Hi Ron, Thank you for your answer.
I ment 'Roy, Thank you for your answer. Smile
Tue, Jun 2 2020 10:44 AMPermanent Link

Raul

Team Elevate Team Elevate

On 6/2/2020 10:00 AM, Ron van Kempen wrote:
> Hi Ron, Thank you for your answer.
>
> Further debugging tells me that the Next statement is not working at all.
> The loop remains processing the first record.
> So my general question is now: What can prevent a Next statement to get  to the next record?
>

Can't say i've ever seen this happen

Can you confirm few things
- version of dbisam
- what is the dataset recordcount (is it 1 or more)
- are you sure nothing else is moving dataset or re-using the underlying
query object or such

Raul

Tue, Jun 2 2020 12:08 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Raul

>Can you confirm few things
>- version of dbisam
>- what is the dataset recordcount (is it 1 or more)

That shouldn't matter - if the table is empty then it should start life as Eof (I quite often have that for reports when I've filter the raw data), 1 record or 1000s of records should be handles in the same way.

>- are you sure nothing else is moving dataset or re-using the underlying
>query object or such

This is my bet - its a very long time since I've used QuickReport and its probably changed a lot since then, and I've never used eDocEngine.

Questions for Ron
- you have the source for QuickReport - what happens when you debug the report.
- are other reports with the same format produced correctly
- have you tried repairing the tables (just a thought - a corrupt index might cause the problem)

Roy
Tue, Jun 2 2020 12:49 PMPermanent Link

Raul

Team Elevate Team Elevate

On 6/2/2020 12:08 PM, Roy Lambert wrote:
>> - what is the dataset recordcount (is it 1 or more)
>
> That shouldn't matter - if the table is empty then it should start life as Eof (I quite often have that for reports when I've filter the raw data), 1 record or 1000s of records should be handles in the same way.
>

Roy,

Agreed but never seen this fail in general.

I'm just curious about edge cases and whether QR code is doing some
other navigation (i.e. maybe BOF gets triggered - just wild guess though)


>> - are you sure nothing else is moving dataset or re-using the underlying
>> query object or such
>
> This is my bet - its a very long time since I've used QuickReport and its probably changed a lot since then, and I've never used eDocEngine.

Worthwhile to check for sure. QR i assume is on main UI thread so we're
looking at application.processmessages being called for anything else to
even have a chance to touch the query.

Raul
Wed, Jun 3 2020 2:31 AMPermanent Link

Ron van Kempen

Microloon bv

I am pretty sure that the next statement itself can not be the real cause of this situation.

> what is the dataset recordcount (is it 1 or more)
It is 1(?) but it should be 212


The following information is taken from my Delphi environment:
 dbisamr448rsdelphiwin3210r.bpl, 4.48.0.4, C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\

I notice a recusive alike processing of the code
TQRController.Execute; > TQRController.PrintBeforeControllers > TQRController.Execute;


The following advice I received from Gnostice(eDocEngine)
"This issue is not related to eDocEngine. Kindly make sure that you are not running infinite loop of DataSet previous and DataSet Next. This may be because when you reach the end of Data Base, you are moving the previous record of data base therefore it is not showing end of database. You can add one more Boolean to check whether you reached end of database before moving to previous . "

And my usage of EdocEngine ( QuickReport ) is quite similar as stated in
https://www.gnostice.com/nl_article.asp?id=248&t=Export_From_Quickreport_To_PDF_And_Other_Formats



Raul wrote:

On 6/2/2020 12:08 PM, Roy Lambert wrote:
>> - what is the dataset recordcount (is it 1 or more)
>
> That shouldn't matter - if the table is empty then it should start life as Eof (I quite often have that for reports when I've filter the raw data), 1 record or 1000s of records should be handles in the same way.
>

Roy,

Agreed but never seen this fail in general.

I'm just curious about edge cases and whether QR code is doing some
other navigation (i.e. maybe BOF gets triggered - just wild guess though)


>> - are you sure nothing else is moving dataset or re-using the underlying
>> query object or such
>
> This is my bet - its a very long time since I've used QuickReport and its probably changed a lot since then, and I've never used eDocEngine.

Worthwhile to check for sure. QR i assume is on main UI thread so we're
looking at application.processmessages being called for anything else to
even have a chance to touch the query.

Raul
Wed, Jun 3 2020 3:29 AMPermanent Link

Ron van Kempen

Microloon bv

Update for my last post:
I have a Delphi 7 Application with the same  case which runs smoothly.
With the same table  that recordCount shows also 1 but it processes fine all the 212 records



Ron van Kempen wrote:

I am pretty sure that the next statement itself can not be the real cause of this situation.

> what is the dataset recordcount (is it 1 or more)
It is 1(?) but it should be 212


The following information is taken from my Delphi environment:
 dbisamr448rsdelphiwin3210r.bpl, 4.48.0.4, C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\

I notice a recusive alike processing of the code
TQRController.Execute; > TQRController.PrintBeforeControllers > TQRController.Execute;


The following advice I received from Gnostice(eDocEngine)
"This issue is not related to eDocEngine. Kindly make sure that you are not running infinite loop of DataSet previous and DataSet Next. This may be because when you reach the end of Data Base, you are moving the previous record of data base therefore it is not showing end of database. You can add one more Boolean to check whether you reached end of database before moving to previous . "

And my usage of EdocEngine ( QuickReport ) is quite similar as stated in
https://www.gnostice.com/nl_article.asp?id=248&t=Export_From_Quickreport_To_PDF_And_Other_Formats



Raul wrote:

On 6/2/2020 12:08 PM, Roy Lambert wrote:
>> - what is the dataset recordcount (is it 1 or more)
>
> That shouldn't matter - if the table is empty then it should start life as Eof (I quite often have that for reports when I've filter the raw data), 1 record or 1000s of records should be handles in the same way.
>

Roy,

Agreed but never seen this fail in general.

I'm just curious about edge cases and whether QR code is doing some
other navigation (i.e. maybe BOF gets triggered - just wild guess though)


>> - are you sure nothing else is moving dataset or re-using the underlying
>> query object or such
>
> This is my bet - its a very long time since I've used QuickReport and its probably changed a lot since then, and I've never used eDocEngine.

Worthwhile to check for sure. QR i assume is on main UI thread so we're
looking at application.processmessages being called for anything else to
even have a chance to touch the query.

Raul
Wed, Jun 3 2020 4:18 AMPermanent Link

Ron van Kempen

Microloon bv

Update 2
I commented out these lines in the loop and then the job is finishing.
212 records as expected. But empty pages.
I think this must be closing this tread, because it shows that the next statement itself is not causing this problem

       //  PrintGroupHeaders;
       // PrintBeforeControllers;
       //  ParentReport.PrintBand(FDetail);
       //  PrintAfterControllers;

Ron van Kempen wrote:

Update for my last post:
I have a Delphi 7 Application with the same  case which runs smoothly.
With the same table  that recordCount shows also 1 but it processes fine all the 212 records



Ron van Kempen wrote:

I am pretty sure that the next statement itself can not be the real cause of this situation.

> what is the dataset recordcount (is it 1 or more)
It is 1(?) but it should be 212


The following information is taken from my Delphi environment:
 dbisamr448rsdelphiwin3210r.bpl, 4.48.0.4, C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\

I notice a recusive alike processing of the code
TQRController.Execute; > TQRController.PrintBeforeControllers > TQRController.Execute;


The following advice I received from Gnostice(eDocEngine)
"This issue is not related to eDocEngine. Kindly make sure that you are not running infinite loop of DataSet previous and DataSet Next. This may be because when you reach the end of Data Base, you are moving the previous record of data base therefore it is not showing end of database. You can add one more Boolean to check whether you reached end of database before moving to previous . "

And my usage of EdocEngine ( QuickReport ) is quite similar as stated in
https://www.gnostice.com/nl_article.asp?id=248&t=Export_From_Quickreport_To_PDF_And_Other_Formats



Raul wrote:

On 6/2/2020 12:08 PM, Roy Lambert wrote:
>> - what is the dataset recordcount (is it 1 or more)
>
> That shouldn't matter - if the table is empty then it should start life as Eof (I quite often have that for reports when I've filter the raw data), 1 record or 1000s of records should be handles in the same way.
>

Roy,

Agreed but never seen this fail in general.

I'm just curious about edge cases and whether QR code is doing some
other navigation (i.e. maybe BOF gets triggered - just wild guess though)


>> - are you sure nothing else is moving dataset or re-using the underlying
>> query object or such
>
> This is my bet - its a very long time since I've used QuickReport and its probably changed a lot since then, and I've never used eDocEngine.

Worthwhile to check for sure. QR i assume is on main UI thread so we're
looking at application.processmessages being called for anything else to
even have a chance to touch the query.

Raul
Page 1 of 2Next Page »
Jump to Page:  1 2
Image