Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to modify a field value dynamically in a report
Message
From
06/09/2009 20:35:07
 
 
To
06/09/2009 18:41:44
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01422876
Message ID:
01422897
Views:
52
Thank you Hilmar.

Saludos,

Alex

>I believe you can have two report variables; one that stores the value of the previous record, and the other that indicates whether you want to print or not. The second one would have to be evaluated first, so that it takes into account the previous value.
>
>Remember that report variables are evaluated for every single record.
>
>llShouldPrint = type("lcPreviousValue") # "C" or FieldToBeChecked # lcPreviousValue
>lcPreviousValue = FieldToBeChecked
>
>The variables are defined from the menu options for the report.
>
>The value, llShouldPrint, can be used as a condition for printing.
>
>The above was not tested, but I believe the general idea should work.
>
>>Thanks for the help Sergey,
>>
>>Yes I have set print repeated values to no. The problem here is that some repeated values, such as units per case in my example, may need to be printed because they belong to the next product even though they are have the same value for two consecutive products.
>>
>>The following is the effect I am looking for. As you see I want to print the number of units per case whenever "Product" changes
>>
>>
>>Assembly    Units/Case          Component           Quantity
>>Product 1          48            Labels                 48
>>                                 Caps                   48
>>Product 2          48            Labels                 48
>>                                 Caps                   48
>>
>>As I mentioned before, in the printed report I accomplished that by storing TRAN(nUnitsPerCase) + ' ' + cProductName in the cursor and then making the report field narrow enough so only the units per case was printed. Since I now wish to use the frx both to print report and to send it to ExcelListener I have run into this problem.
>>
>>Is there a way to make a field not print based on whether some *other* field has repeated?
>>
>>TIA,
>>
>>Alex
>>
>>>Did you try to set Print repeated values to No for the fields in question?
>>>
>>>>In a report I'd like several fields not to be printed in a line if one of them has a repeated value. For example, if a product name is repeated I'd like not to print the units per case either.
>>>>
>>>>Originally I solved this by appending the product name to the units per case and making the width of the field narrow enough so the appended name was not printed. Now I am offering the user the option of exporting the report to excel and naturally the appended product name goes along. The user is not asked the report destination until after all data is prepared, and that is done in a process that I prefer not to touch, so it is not really feasable to change the value in the cursor.
>>>>
>>>>Sounds like a job for dynamic formating, except I don't know how to accomplish it.
>>>>
>>>>TIA,
>>>>
>>>>Alex
Previous
Reply
Map
View

Click here to load this message in the networking platform