AnsweredAssumed Answered

Print Record Script not able to Print Current Record

Question asked by NaturSalus on Dec 12, 2011
Latest reply on Dec 13, 2011 by NaturSalus

Title

Print Record Script not able to Print Current Record

Post


Hello,


All the data of my current project come from the DEVIATION table


In order to generate and print a Report that contains data counts per Year, Quarter, Month, Deviation Origin, and Deviation Subject I have set up the Deviation History Report Layout (Default view: List view) based on the DEVIATION table.


Deviation History Report Layout Structure


The Deviation Report layout has the following structure:

 

HEADER that contains the "Deviation Report" text and "Total" text


Sub_summary by z_DateDeviationYear (Leading) that contains the folllowing fields:

DEVIATION::z_DateDeviationYear and DEVIATION::DeviationCount

 

Sub_summary by z_Quarter (Leading) that contains the folllowing fields:

DEVIATION::z_Quarter and DEVIATION::DeviationCount

 

Sub_summary by z_DateDeviationMonth(Leading) that contains the folllowing fields:

DEVIATION::z_DateDeviationMonthDate and DEVIATION::DeviationCount

 

Sub_summary by DeviationOrigin (Leading) that contains the folllowing fields:

DEVIATION::DeviationOrigin and DEVIATION::DeviationCount


Sub_summary by DeviationSubject (Leading) that contains the folllowing fields:

DEVIATION::DeviationSubject and DEVIATION::DeviationCount


FOOTER with the Date Printed and Page Number



Deviation History Report Structure Purpose


The purpose of the Deviation Report is to come out with the following basic report:

 

Deviation Report                                    Total

Year                                                       Number of Deviations per Year

Quarter                                                   Number of Deviations per Quarter

Month                                                    Number of Deviations per Month

Deviation Origin                                    Number of Deviations per type of Deviation Origin

Deviation Subject                                  Number of Deviations per type of Deviation Subject



 

On the Deviation Detail Layout, based on the DEVIATION table, I have a Print icon attached to the Print Report Script.

 

The Print Report Script generates and prints reports based on the user choice of: “All”, “Current” or “Cancel” to the question: Would you like to print the deviation in the found set or just the current contact?

 

The contents of the Print Report Script are the following:


Allow User Abort [ Off ]

Set Error Capture [ On ]

Enter Browse Mode

New Window [ ]

Adjust Window [ Maximize ]

Go to Layout [ “Deviation_History_Report ” (DEVIATION) ]

Show Custom Dialog [ Title: "All or Current?"; Message: "Would you like to print the deviation in the found set or just the current contact?"; Buttons: “All”, “Current”, “Cancel” ]

If [ Get(LastMessageChoice) = 1 ]

Show All Records

Sort Records [ Restore; No dialog ]

Print [ Restore: Samsung ML-2010 Series ]

Else If [ Get(LastMessageChoice) = 2 ]

Show All Records

Omit Record

Show Omitted Only

Sort Records [ Restore; No dialog ]

Print [ Restore: Samsung ML-2010 Series ]

End If

Adjust Window [ Restore ]

Go to Layout [ original layout ]



The “record showing” part of the Print Record Script works fine since:

  • it shows all the records if the user chooses “All”

  • it shows just the current record if the user chooses “Current”

  • cancels if the user chooses “Cancel”



The problem lies with the “record printing” part of the Print Record Script since:

  • when the user chooses “All”, it prints all the records as expected.

  • when the user chooses “Current”, it prints just the Header and Footer part of the Report and not the contents of the Subsummary parts



So, even though I can preview the current record correctly I cannot print it, neither to a printer neither to a PDF file.


Although without any logical basic, I tried to change the Default View of the Deviation History Report layout from List View to Form View, but it didn't make any difference.

At this point I have no clue whether the problem is in the Deviation History Report layout settings and/or the contents of the Print Record Script.



Any help to make it work is greatly appreciated.


natursalus

Outcomes