Titleband causing report to go haywire
We are trying to get out our final version before moving to Delphi 2007 and
the latest version of Report Builder. We are currently using Delphi 5 and
Report Builder 7.04. I understand this is old and you don't support it
anymore but I could REALLY use your help. Hopefully this is a known issue
with an easy solution.
Our application has 39 reports some of which are very complex but none of
which were using the Title Band. Our customers have been requesting one for
some time so we decided to implement it as one of the enhancements for this
final D5 version. I had a unit called uPrintHeader which I would pass the
report to where our standard header band is created. I added a routine to
create the objects on the cover page as well. Here is the problem: All but
two of my reports work perfectly with the new TitleBand and print correctly
whether the TitleBand is turned on or off. My two most important reports
(of course) look fine in print preview but when I go to print them they go
crazy. The cover page seems to print fine (sometimes) but the Header Band
info may be missing on the second page or sometimes the second page is
mostly blank and a third page is added which is also mostly blank. There
should only be two pages and the system variable on the third page reads
"Page 3 of 2".
If I don't fill in the Title Band if the cover page is turned off (i.e. no
components on the title band) and the Title Band is set to ".Visible :=
false" then the report seems to print fine. If the Titleband has components
on it even if the visible property for the title band is set to false, the
report is messed up when printed with the HeaderBand not even printing.
This is very frustrating and I am at a loss. I am up against a deadline and
this HAS to be in this release. Please help!
Again, the print previews are working fine. All reports except for these
two print to the printer just fine. And to top it off it seems to print to
the HP Laserjet 5 just fine. Any other printer in the office and these two
reports come out crazy. If they are exported to PDF using the Pragnaan
Software it looks crazy.
Sincerely,
Mark Greenhaw
OneDomain, Inc.
the latest version of Report Builder. We are currently using Delphi 5 and
Report Builder 7.04. I understand this is old and you don't support it
anymore but I could REALLY use your help. Hopefully this is a known issue
with an easy solution.
Our application has 39 reports some of which are very complex but none of
which were using the Title Band. Our customers have been requesting one for
some time so we decided to implement it as one of the enhancements for this
final D5 version. I had a unit called uPrintHeader which I would pass the
report to where our standard header band is created. I added a routine to
create the objects on the cover page as well. Here is the problem: All but
two of my reports work perfectly with the new TitleBand and print correctly
whether the TitleBand is turned on or off. My two most important reports
(of course) look fine in print preview but when I go to print them they go
crazy. The cover page seems to print fine (sometimes) but the Header Band
info may be missing on the second page or sometimes the second page is
mostly blank and a third page is added which is also mostly blank. There
should only be two pages and the system variable on the third page reads
"Page 3 of 2".
If I don't fill in the Title Band if the cover page is turned off (i.e. no
components on the title band) and the Title Band is set to ".Visible :=
false" then the report seems to print fine. If the Titleband has components
on it even if the visible property for the title band is set to false, the
report is messed up when printed with the HeaderBand not even printing.
This is very frustrating and I am at a loss. I am up against a deadline and
this HAS to be in this release. Please help!
Again, the print previews are working fine. All reports except for these
two print to the printer just fine. And to top it off it seems to print to
the HP Laserjet 5 just fine. Any other printer in the office and these two
reports come out crazy. If they are exported to PDF using the Pragnaan
Software it looks crazy.
Sincerely,
Mark Greenhaw
OneDomain, Inc.
This discussion has been closed.
Comments
When dealing with complex reports, it is sometimes hard to pinpoint a
specific issue that could be causing the problem. I took a look at the
known issues for RB 7.04 and did not see anything dealing with the use of
the Title band. Are you by chance using Fixed style subreports in these
reports?
For the next incremental step towards solving this issue, I would recommend
simplifying one of the affected reports by first removing all the event
code. If this solves the problem, you can periodically being adding it back
to see where the problem lies. Another option that almost always works it
to consider rebuilding the report from scratch (including the new title band
option). In doing so, you may run across the issue at a simpler state or
may find some place you can refactor your code or design to provide a better
report.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
reports but the same one in reports that work fine. I did just notice
something odd though. The breakpoint that I placed in
ppGroupHeaderBand1BeforePrint gets hit when my report is generating for the
print preview but when I hit the Print button, the program never goes back
into that routine.
Mark Greenhaw
One Domain, Inc.
What happens when you print to the printer directly (no preview)?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
options on the print preview a user can change which will affect the report
so not giving them a print preview is really not an option though. :-( For
instance, they can change the font of the report, change from a two line to
a one line footer, go form a learge hader to a small header. the report is
regenerated after they make a change in print preview. During my testing of
this problem though I was not making any changes to these things. I was
just printing as it came intot the print preview. As I stated above though
it is working fine on most reports and worked fine on all of them until I
added the objects to the title band.
Thanks for you suggestions and help. Please keep them coming.
Mark Greenhaw
One Domain, Inc.
This was just a test to try to isolate the problem. This means the problem
only occurs when printing from the preview window. I'm concerned about the
GroupHeaderBeforePrint event not firing when printing to the printer. Are
you sure this band is actually being generated when printing to the printer
(from the preview)? What code is executed in this event? Are there any
other events that fire (or don't fire) for the preview but not when
printing?
As a test, save a copy of one of the affected reports and try removing the
group mentioned above and see if that helps the issue.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I am getting an access violation now when I try to print from the print
preview. Again, the print straight to printer works fine. Everything looks
fine in print preview but if you try to print from there it errors out with
an access violation. I zipped it up and sent it to you. I used only
standard components so you should be able to just compile and run it.
Again, I am using D5/RB7.04. Once this release is out the door we are
moving to D2007/RB10 so I really want to put this one to bed. :-)
Thanks again for your help.
Mark Greenhaw
One Domain, Inc.
all of the updates and made the necessary changes to my code to get it to
compile and run. This problem is still showing up. Certain printers print
this just fine. Other printers go schitzoid. Worked fine on the Laserjet 5P
here in the office but on my Canon ImageCLASS D660 and a Brother HL1240 it
doesn't print the header band and leaves two labels off the title band as
well as various other discrepancies.
Just to reiterate, it initially shows up fine in the print preview. I print
it and it is wrong on the printer. Then if I change pages in the print
preview it mimics what was printed(which was wrong).
Please try the code I sent you on multiple types of printers (If I need to
resend it or to send you the executable i compiled just let me know). There
is still a very important issue here.
Sincerely,
Mark Greenhaw
One Domain, Inc.
P.S. There is no chance that there is code left on this machine from Delphi
5/RB 7.04. I Ghosted it back to the factory configuration and installed
Delphi 2007/RB 10.07 on a fresh machine.
This is interesting. I've tested on my HP LaserJet 5 and HP C6180 and am
unable to see this behavior. I will try to download the drivers for the
printers you are using and see if I can find anything however ReportBuilder
is designed to use the Windows API to send generic commands to each printer
driver. There is no difference between the commands sent to your HP or
Canon printers.
Out of curiosity, are you able to export these reports to PDF and
successfully print from Acobat Reader?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com