Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying cross tab data?
Message
From
27/07/2007 13:49:01
 
 
To
27/07/2007 11:22:32
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Miscellaneous
Thread ID:
01243774
Message ID:
01244192
Views:
19
>I'm not sure either, but what steered me in the right direction was the use of the FIELD() API, in conjunction with tests for columncount FCOUNT(). Granted this is not perfect, as I can only put upwards of 10 columns in the report, but the user in theory could setup hundreds of columns (very unlikely).

The page mechanism is exactly the way you deal with an unknown number of columns. But perhaps the term "page" is confusing.

The idea is that, as with a spreadsheet, you have multiple pages across as well as down. So the calculation I showed is to figure out how many pages _wide_ the report is and the complex expression for each field lets you run the report multiple times, but get different results depending on the value of the nPage variable.

Say your user picks 87 columns and you've design the report with 10 columns. If you use the mechanism from Nancy's article, the nPages variable will be 9 and the REPORT FORM will run 9 times. The first time, it'll report on fields 1-10; the second time, fields 11-20, and so forth, until the last time through the loop, it does fields 81-87.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform