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

Comments

  • edited January 2014
    Hello Again,

    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
    SeaCay wrote: »
    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
  • gordkgordk St.Catherines On. Canada.
    edited 2:04AM
    check that the design of the report is using the correct printer and not sending it to an off line printer
  • edited 2:04AM
    Hello Gordk,

    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
    gordk wrote: »
    check that the design of the report is using the correct printer and not sending it to an off line printer
  • gpigpi
    edited 2:04AM
    Attach small demo project with problem here
  • edited 2:04AM
    Establish whether the problem is the report, or the last report of the series.
    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?

  • edited 2:04AM
    I've got a bit further with the issue now.
    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
    technisoft wrote: »
    Establish whether the problem is the report, or the last report of the series.
    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?
  • edited 2:04AM
    That the report goes to a disk file makes me think that there is some export component attached to that report.
  • edited January 2014
    Hello technisoft and all,

    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
      GadCon.Database := extractFilePath(application.ExeName) + '\MonRep.fdb';
      GadCon.Username := 'SYSDBA';
      GadCon.Password := 'masterkey';  // no surprises, not the real password
      GadCon.Connect;
      GadQry.FetchAll := true;
      GadQry.Prepare;
    
      GadQry.Open;
    
      if gadQry.RecordCount > 0 then begin
        frDBSrc1.DataSet := gadQry;
        frRep.LoadFromFile(extractFilePath(application.ExeName) + '\MonRep.fr3');
        frRep.PrintOptions.PrnOutFileName := 'SeaCay''s Monthly Summary';
    
        sleep(500);
        printers.Printer.Orientation := printers.poPortrait;
        GadQry.First;
        produceReportOutput;
      end;
      if GadQry.Active then
        GadQry.close;
      if GadQry.Prepared then
        GadQry.UnPrepare;
    

    The "produceReportOutput" code is
        frRep.ShowReport;
    // ...or...
    //    frRep.Print;
    

    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
    technisoft wrote: »
    That the report goes to a disk file makes me think that there is some export component attached to that report.
  • edited 2:04AM
    Hello All,

    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
    SeaCay wrote: »
    Hello technisoft and all,

    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
      GadCon.Database := extractFilePath(application.ExeName) + '\MonRep.fdb';
      GadCon.Username := 'SYSDBA';
      GadCon.Password := 'masterkey';  // no surprises, not the real password
      GadCon.Connect;
      GadQry.FetchAll := true;
      GadQry.Prepare;
    
      GadQry.Open;
    
      if gadQry.RecordCount > 0 then begin
        frDBSrc1.DataSet := gadQry;
        frRep.LoadFromFile(extractFilePath(application.ExeName) + '\MonRep.fr3');
        frRep.PrintOptions.PrnOutFileName := 'SeaCay''s Monthly Summary';
    
        sleep(500);
        printers.Printer.Orientation := printers.poPortrait;
        GadQry.First;
        produceReportOutput;
      end;
      if GadQry.Active then
        GadQry.close;
      if GadQry.Prepared then
        GadQry.UnPrepare;
    

    The "produceReportOutput" code is
        frRep.ShowReport;
    // ...or...
    //    frRep.Print;
    

    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
    SeaCay wrote: »
    That the report goes to a disk file makes me think that there is some export component attached to that report.
  • Delete the line with PrnOutFileName and try again

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.