Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying cross tab data?
Message
 
 
À
26/07/2007 13:52:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Divers
Thread ID:
01243774
Message ID:
01243930
Vues:
23
Thanks Tamar, not sure why I didn't think of that technique. Now I just have to figure out why the object rotation isn't working...



>>I am designing a report, and need to display cross-tabbed data. The data has already been pivoted. My task is to display this data that has an unknown number of columns at design time.
>>
>>Is there a solution for this problem?
>>
>>One thought I had was to build up HTML from the pivoted data, but I'm not sure if VFP report designer can display html.
>
>Nancy Jacobsen published a solution to this problem in FoxTalk a long, long time ago (1990 or 1991, I think).
>
>The basic idea is that you set up your report with as many columns as fit comfortably. In the calling program, you use code like:
>
>nColumns = # of data columns in the report
>nDataFields = FCOUNT() - 1 && first field is label
>nPages = INT(nDataFields/nColumn) + 1
>
>FOR nPage = 1 to nPages
> REPORT FORM (YourReport)
>ENDFOR
>
>In the report, you use a complicated expression involving the FIELD() function and nPages to put the fields (and the headings) in place. It varies from column to column, but it's along these lines (this one is for the first data column):
>
>IIF(TYPE(FIELD((nPage-1)*nColumns + 1)) <> "U", ;
>FIELD((nPage-1)*nColumns + 1),"")
>
>IOW, the first time through the loop, you report on data columns 1 through nColumns. The second time, it's nColumns + 2 up to 2*nColumns, etc.
>
>The expression for the data checks whether there's a field to report on in this column and if so, shows the data.
>
>Hope this helps.
>
>Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform