Print Report Header, No Records

Bruce Easton bruce at stn.com
Thu Nov 19 15:26:31 PST 2015


On 11/18/15 9:18 AM, Bruce Easton via Filepro-list wrote:
> On 11/18/15 12:59 AM, Bruce Easton via Filepro-list wrote:
>> On 11/17/15 8:07 PM, Jim Asman via Filepro-list wrote:
>>> Is there an easy way to force a report header to print even
>>> those no records were selected?
>>>
>>> I thought that maybe a print command in @done processing might
>>> do it, but that doesn't appear to work.
>>>
>>> I can do this the hard way, but I thought I would ask first.
>>>
>>> Thanks,
>>>
>>>
>>>
>>> Jim
>>> -- 
>>> jlasman at telus.net                      Spectra Colour Services Ltd.
>>> Phone: (604)584-0977                   Surrey, BC  CANADA
>>>   Cell: (604)619-0977 www.spectracolorservices.com
>>>
>>> _______________________________________________
>>> Filepro-list mailing list
>>> Filepro-list at lists.celestial.com
>>> Subscribe/Unsubscribe/Subscription Changes
>>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>>>
>> Ken replied to someone recently about this with:
>>
>> 'As you already noted, @DONE is executed after all printing is done, 
>> so it's too late to print something there.
>>
>> Also, @WGT is, by default, not executed if no records are selected. 
>> However, that default behavior can be overridden by setting 
>> "PFWGT0=ON".'
>>
>>
>> Bruce
>> _______________________________________________
>>
>>
> Additionally, ever since this came up recently, "@wgt0" kept ringing a 
> bell (as a label).  I don't see anything about it in help anywhere, 
> but maybe I missed something.  It seems I've used it in a number of 
> places.  Also, evidently I've I used it on a system where "PFWGT0" is 
> not set.  It looks like it's a label that filepro respects as a 
> trigger since I don't see anything on my part allowing flow to the label.
>
> I don't see any examples where I've used it to try to add something to 
> a print destination.  Looks like I've only used it for appending to a 
> file write via writeline and close; or issuing html commands to wrap 
> something up.  So maybe filepro does see this as a trigger when no 
> records are selected, but can't use it by itself for appending to 
> print destination.  Granted, this is still BC (before coffee).
>
> ---
OK, I think I've discovered why I was so confused about this.  I still 
haven't located the code that I am vaguely remembering, but basically I 
used to do something like this (and yes, with PFWGT0 env set):

@wgt     If: @ts eq "0"
         Then: goto @wgt0
              If:
         Then: '(otherwise do whatever - write to/close files or "print; 
end"; etc.)
              If:
         Then: end
@wgt0   If:
          Then: '(do special processing when no recs selected)
          Then: end

I've tested though various cases for this writing to a temp file with 
different expressions in place of where I show comments above.

OK, not too much magic there - just using the custom label to indicate 
what to be done when no recs selected.
What's interesting is that in this case filepro ingores the custom label 
(as a reserved trigger such as @wgt or @wef) and acts normally doing 
what is indicated until and end command.  HOWEVER, at least what I'm 
seeing in 5.0.14, if you have an @wgt0, or for that matter @wgt@@@ 
(where @@@ is seemingly anything), filepro will just interpret the first 
such expression it comes to as its trigger @wgt entry point.   (So, 
again with PFWGT0 set, then in the example above, if I switched  the two 
labels, I would still get the same behavior  - in that case filepro will 
see "@wgt0" as its trigger entry point, and "@wgt" as a non-trigger 
label.  So filepro is a) ignoring anything coming after "@wgt" when 
looking for the trigger label; and b) ignoring any subsequent occurrence 
without complaint ['There can be only one @wgt in this town'].)

Somewhere along the way, I must have copied code that used "@wgt0" 
label, but didn't need a differentiation between zero or some records 
selected (for the few tables I have been able to locate), but it still 
ran as expected simply because the intended trigger started with "@wgt".








---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the Filepro-list mailing list