Solved

Another problem with Delphi3/QuickReport

Posted on 2004-10-28
751 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
Question by:NetGeek
    9 Comments
     

    Author Comment

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

    Expert Comment

    by:vadim_ti
    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
    >> 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
    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
    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:
    Are you tried
    ReprintOnNewPage GroupHeader property?
    0
     

    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Course: Foundations of Front-End Development

    Jump-start a lucrative career in front-end web development, with zero previous coding experience required. This course covers the basic programming concepts and languages required for creating engaging websites from scratch.

    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…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    877 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now