` Printed Icetips Article

Icetips Article



ABC: Fixing GPF when there are no records to print in reports
1999-03-31 -- Geoff Bomford
 
Newsgroups: topspeed.products.c5ee.reports

>When trying to print a report from a file that happens to have no records, I
>get the following message: (after another message box appears to indicate
>that there are no records to print)
>
>'Window is not open. Shall I GPF?'

Enclose any Prop setting within a check for returnvalue...

IF NOT ReturnValue    ! the report was opened.
  SETTARGET(Report,?AbbrevBreak)             !Embed
  ?Image2{PROP:Text} = TPL:LogoFileName    !Embed - End User Logo
  SETTARGET                                                  !Embed
END

--

Regards,
Geoff Bomford


>I've reached the conclusion that if I remove the three lines below relating
>to SETTARGET(....) the problem goes away.
>
>Below is a section of code extracted from the Source Option:
>
>ThisWindow.Init PROCEDURE
>  ... some code
>  ! Open the window
>  OPEN(ProgressWindow)
>  SELF.Opened=True
>  ! [Priority 8001]
>
>  SETTARGET(Report,?AbbrevBreak)             !Embed
>  ?Image2{PROP:Text} = TPL:LogoFileName    !Embed - End User Logo
>  SETTARGET                                                  !Embed
>
>  ! Restore from INI file
>  INIMgr.Fetch('PrintIssueRegister',ProgressWindow)
>  ! [Priority 8400]
>
>
>ThisReport.Init(Process:View,Relate:IssRep1,?Progress:PctText,Progress:Thermometer)
>  ThisReport.AddSortOrder()
>  ThisReport.AddRange(REP1:ProjectNo,GLO:ProjectNo)
>  etc. etc. etc...
>
>Any ideas on how to circumvent this one?



Printed November 21, 2024, 6:45 am
This article has been viewed/printed 35391 times.
Google search has resulted in 45 hits on this article since January 25, 2004.