I'm not sure what you're trying to accomplish, but I would suggest adding the column at design time. Use "Print when" to keep the items in the column from printing when they're not wanted.
May be you don't understand with my idea. I only want to print fields that selected from a listbox, each of field will containted a column of report. Here is problem.
I don't understand about "Print when". Please explain me!
Thanks!
It's very difficult to select fields for printing at run time. You have to understand the contents of the report's FRX file and change it dynamically. I don't recommend you try to do this, unless you really understand the issues.
An alternative approach might be to add an extra column to your report at design time. Set its expression to, say, MyField. Make it wide enough to hold the contents of any of the user-selected fields.
Then, add a new field called MyField to the cursor or table that drives the report. At run time, fill this field with the contents of the field that the user selected.
Hope this makes sense.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
It won't give you a gorgeous result, but it'll work.
Another alternative is to set up the maximum number of columns you'll need and specify the data as FIELD(1), FIELD(2), etc., so you don't have to know the names.
In either case, you'll want to use the choices from the list in a query to put the exact data you want into a cursor.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.