Report Shows on Screen but won't spool to Print Queue
Hello All,
I generate a series of reports (15 in all). They all show on screen and all print except the last report in the series.
The last report shows clearly and accurately in the preview window but when the Print button is clicked within the Preview window, I get the usual dialog and click Ok, a new dialog pops up indicating "Printing Page #1" but nothing goes to the print queue.
I have tried :
- removing all report bands on an individual basis
- rebuilding the report
- re-installing Fast-Reports
- checked many attributes to ensure they are set to print
I am using Delphi XE3 (fully updated) and Fast-Reports version 4.15
I would be very pleased if someone could identify the problem.
regards
SeaCay
I generate a series of reports (15 in all). They all show on screen and all print except the last report in the series.
The last report shows clearly and accurately in the preview window but when the Print button is clicked within the Preview window, I get the usual dialog and click Ok, a new dialog pops up indicating "Printing Page #1" but nothing goes to the print queue.
I have tried :
- removing all report bands on an individual basis
- rebuilding the report
- re-installing Fast-Reports
- checked many attributes to ensure they are set to print
I am using Delphi XE3 (fully updated) and Fast-Reports version 4.15
I would be very pleased if someone could identify the problem.
regards
SeaCay
Comments
The problem still persists.
I have rebuilt the report from both a template and from scratch and still the report refuses to print. On screen the report looks perfect but when the print button is clicked, no output is generated.
If I export the report to a PDF, I have no problems and the report prints fine to a PDF file.
I should have added in the previous post that I am accessing the data from a Firebird (2.5) database. The data is all ASCII strings. I have searched for stray unprintable characters and found none.
Also, it is worth bearing in mind that not only does this report not print on my development system, it also does not print on the production system nearly 1000 Km away.
I really need some suggestions on this issue please.
regards
SeaCay
Thank you for your feedback.
In design mode with the same production data, in report view mode, the report will print to the default printer.
In code testing mode, the report will not print. The TFrxReport printer property is set to <Default>.
When the printing report from code, the dialog box shows the printer I need which is online and only a metre away from me. Checking other reports, using the same code, they all print fine under these conditions.
Again, my thanks for your support on this problem.
regards
SeaCay
Make the last report the first one and check what happens. Is the (new) last report having the same problem and the first (the old last) one prints fine?
If the problem moves with the report then it is the report. If not then it is something in the series.
Could you merge all 15 reports into a single one?
What happens if you print immediately without preview?
But first to answer technisoft's questions...
The problem is definitely the last report in the series.
I cannot make the last report the first one, as this report is the executive summary and relies on the processes run to generate the previous reports.
Printing without preview does not print.
However I have found that the printout goes to a hard disk file. This amazes me. The print dialog box definitely does not have "Print To File" checked. I have verified this now 5 times. See attached.
So now my question becomes, "What else forces a report to print to a file?"
My sincerest thanks to all who have responded. I look forward, with appreciation to the next replies.
regards
SeaCay
Thank you for your thoughts.
I have cut the app down to a simple Delphi VCL form with
- 1 only TIDCConnection - DevArt Firebird DB Connection component, named GadCon
- 1 only TIDCQuery - DevArt Firebird Query Component, named GadQry
- 1 only TFrxReport - FastReports Report Component, named FrRep
- 1 only TfrxDBDataSet - FastReports Connector Component, Named FrDBSrc1
I create nothing in code.
My code is very simple
The "produceReportOutput" code is
Other code not shown is a test for a valid date and an OnFormClose which clears the query SQL and closes the DB connection.
There are no other components nor code.
The DB consists of 1 table, 1, trigger and 1 generator. The table holds 14 records which are in 8 categories.
I have attached the .fr3 file for reference. You will see that its is a very simple report on A4 with a Group Band and a MasterDetail band. The Group Band has one DB field and the MasterDetail band has 3 DB fields.
I cannot see why this report wants to print to disk. I am happy to upload the entire project if requested.
I believe that in all likelihood this problem will prove to be very simple to resolve but I just can't see it.
My thanks to all contributors, I really appreciate all suggestions.
regards and thanks
SeaCay
I think I have solved the problem.
The issue seems to lie with the line of code:
frRep.PrintOptions.PrnOutFileName := 'SeaCay''s Monthly Summary';
It seems that if TfrxReport.PrintOptions.PrnOutFileName has a non-empty string, the report is forced to a file.
I would have thought that in setting a name, it would be a preparitory operation only and not a request to print to a file. ie "if I decide to print to a file, this is the name I want"
I have looked in PDF files and FR online documentation for info concerning this setting but can't find any.
Of course should you want to name the outpput in the output queue, you would use TfrxReport.PrintOptions.Name
So, after 5 days of non-productive time, I have a solution.
My warmest thanks to those who have responded and given valuable suggestions.
Many thanks
SeaCay
Delete the line with PrnOutFileName and try again