Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Another problem with Delphi3/QuickReport

Posted on 2004-10-28
10
Medium Priority
?
767 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:NetGeek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 

Author Comment

by:NetGeek
ID: 12432888
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
 
LVL 6

Expert Comment

by:vadim_ti
ID: 12433465
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
 

Author Comment

by:NetGeek
ID: 12433502
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 6

Expert Comment

by:vadim_ti
ID: 12434003
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
 

Author Comment

by:NetGeek
ID: 12434082
>> 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
 
LVL 6

Expert Comment

by:vadim_ti
ID: 12434404
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
 

Author Comment

by:NetGeek
ID: 12434480
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
 
LVL 6

Accepted Solution

by:
vadim_ti earned 1000 total points
ID: 12435550
Are you tried
ReprintOnNewPage GroupHeader property?
0
 

Author Comment

by:NetGeek
ID: 12441888
hmm, that would be nice, but working in Delphi3 i only got ForceNewPage, PrintBefore and PrintIfEmpty
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question