Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report with unlimited count of columns... It is possible
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00026046
Message ID:
00026099
Views:
33
Vladimir,

Sorry about deleting the info that went before this

I'm not 100% certain that I really understand your question, but I think it's along these lines:

You want to be able to develop a single report that will handle, but can't because the field names and number are unknown. Do I have this right?

If so, then here's your answer:

In your detail line you can use, for example:

&FIELD(2)

to print the output

For column headers simply:

FIELD(2)

Naturally, the 2 above is just an example.

In those instances where the number of columns isn't known, you can use the following syntax.

IIF(FCOUNT() >= 10, &FIELD(10), "")

for detail lines and

IIF(FCOUNT() >= 10, FIELD(10), "")

In regards to the column headers, if I recall correctly, GENXTAB uses some like "N" + the string representation of the value for numeric columns, and I think something like Expr_1, Expr_2 for you'll have to check. If this is the case, I suggest using a function to return a value in the column expression:

IIF(FCOUNT() >= 10, ColFunc(10), "")

The function would have to return a string that corresponded to the desired column heading. You may have to generate a cursor with the orginal field values. Assuming that the distinct values that make up the columns are: "Microsoft", "FoxPro", and "Visual" and that there's a cursor with the alias ColHeads (with the names in the field NAMES). Your function would look something like:

FUNCTION ColFunc

LPARAMETER pn_recno

LOCAL lc_result

lc_result = ""
IF RECCOUNT("ColHeads") <= pn_recno
GO pn_recno IN ColHeads
lc_result = ColHead.Names
ENDIF
RETURN lc_result
ENDFUNC

For numerics, you could use the SUBSTR() function to return a portion of the numeric field name desired.

Good Luck,

George
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform