Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recalc report every time a Detail Band line is printed.
Message
From
18/06/1999 13:15:33
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00231182
Message ID:
00231495
Views:
22
>David,
>
>Here's what I did. Create a report, in it place a field and then a second one the is below and to the right of the first. I created two variables in the command window, lcLastCust (last customer ID) and llNewCust (T/F is this a new customer).
>
>I wrote the following UDF;
>
>
>* ChkLastCust
>lcRet = lcLastCust
>IF Cust_id = lcLastCust
>	llNewCust = .F.
>ELSE
>	llNewCust = .F.
>ENDIF
>lcLastCust = Customer.cust_id
>RETURN lcRet
>
>
>The expression for the second field is ChkLastCust(). In teh example above the UDF returns the name of the current customer.
>
>If you run the report you will see the current customer's ID with the ID of the previous customer to the right of it.

Sorry to be dense Jim, but I'm not sure why the snippet above does anything.
Even if I assume you meant .T. in the ELSE clause (and I'm assuming that
Cust_id & Customer.cust_id both refer to the same object). The UDF doesn't do anything with llNewCust after calculating it, and since (I assume) it's a local variable to the UDF, it's invisible to the caller.

I do understand that you are using a UDF in conjunction with the two fields, but not sure exactly how this is implemented. Is the UDF defined in the program that invokes the report generator? - I need to know how to get the UDF within the scope of the report generator. You may have noticed my message under TROUBLESHOOTING where I generated a page fault. This was because I had attempted to create a method in the report DE's object ... that didn't work, but the concept of using a function to return the desired results has occured to me. Just don't know how to implement it yet.
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform