Another problem with Delphi3/QuickReport

Hi there,

I have an application written in Delphi3 that uses QuickReport for reporting. On the report I have a subdetailband with a headerband and a footerband. Sometimes the number of records in the dataset set as dataset for the band is so big that the subdetailband will print over 3 or more pages. Everytime this happens I get an exception of class EFCreateError "Cannot create file (and then 3 boxes for characters not showable)" and when I run again an exception class EInvalid Operation ""Canvas does not allow drawing". Itøs always happening during the call to Prepare like this:

MyForm.QuickRep1.prepare;  // this call creates the exceptions
MyForm.QuickRep1.QRPrinter.free;
MyForm.QuickRep1.QRPrinter := nil;

even if I leave out the call to prepare (which I donøt want to because I need it to show the total number of pages in the actual preview) and just call

MyForm.QuickRep1.Preview;

I get the same execptions. If the number of records so that the report only takes up two page, everything works fine.

UPDATE: Through Showmessages I've found out that the exception occurs after EndPage of page 2 and after Afterprint on the footerpand on page 2, but before the Startpage event for page 3 is fired.

Any ideas ?

take care
NetGeek
NetGeekAsked:
Who is Participating?
 
vadim_tiConnect With a Mentor Commented:
Are you tried
ReprintOnNewPage GroupHeader property?
0
 
NetGeekAuthor Commented:
Never mind, I found out that if I set the QuickRep1.Options[Compression] to true, the execptions don't occur :)

You can still earn the points if you can tell me how to get a headerband for a subdetailband to print again on every new page. On nthe headerbnad for the subdetailband i have the headlines for each column, and it looks like s.... to have the subdetailband continuing on the next page without the headlines.

take care
NetGeek
0
 
vadim_tiCommented:
create childband for pageheader band
copy / paste all labels from headerband to new band
delete your headerband

when you use prepare QR creates metafile in temporary directory
may be you have a problem with your windows temporary directory (too long name)
it is  a known issue with qr.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
NetGeekAuthor Commented:
HI vadim, I think you answer was for my initial problem. If you read my second comment, you'll see that I found the solution myself. But please feel free to anser the second question ;)

take care
NetGeel
0
 
vadim_tiCommented:
it is for your second problem
   create childband for pageheader band
   copy / paste all labels from headerband to new band
   delete your headerband

your first problem will return to you if your report will be bigger

0
 
NetGeekAuthor Commented:
>> vadim

then I'm not sure I understand you correctly.

Say my Subdetailband is called DataBand, with HeaderBand property set to SubDetailBand1. Do you mean I should placve a ChildBand on the form, copy the content of SubDetailBand1 onto this new band, delete SubDetailBand1 and then set the HeaderBand property of DataBand to the name of the new band ?
0
 
vadim_tiCommented:
no

you place PageHeader band on the form, after it set its HasChild to true.
childband will be created,
after it paste/copy the content of SubDetailBand1 onto this new band, delete SubDetailBand1

no need in HeaderBand property
0
 
NetGeekAuthor Commented:
uhoh, I'm afraid I've left something out that I should have told from the start.

I already have a Pageheaderband on the report, with company details, pagenumber etc. Below that I have nine subdetailbands, grouped in three, where number 2 5 and 8 has 1 and 4 and 7 has headerbands (groupheader) and 3 and 6 and 9 as footerbands(groupfooters). Finally I have a pagefooterband. What I need to do is to get the groupheaderband of the group that causes the next page to display right after the pageheaderband, before the groupdetailband continues to print.

I hope this clarifies things, and I'm sorry for messing up things at first.
0
 
NetGeekAuthor Commented:
hmm, that would be nice, but working in Delphi3 i only got ForceNewPage, PrintBefore and PrintIfEmpty
0
All Courses

From novice to tech pro — start learning today.