I’d like to have a checkbox on a report request form that determines when a column appears on a report. How do I link the request form and report up? is it an IF statement or something? thanks
I assume that you have made the source expression of the check box on your request form a global boolean variable. The state of the variable can then be used to determine if the report section containing your optional column is displayed or not by using the CurrReport.SHOWOUTPUT function on the PreSection code trigger. As the parameter of this function is also boolean you can use the varibale directly…e.g. CurrReport.SHOWOUTPUT(GbooShowColumn) I hope this helps. Chris.
hi Mr. Wilson is right. There is no dierct way to hide a column on a report. Using different section is the only way to do it. harikesh
Hi jgr, it’s correct, you cannot directly hide/show columns via code, unless you establish several sections with the possible combinations. Nevertheless, you can via code “reset” the fields in the OnAfterGet trigger of the respecitve dataitem and/or set the property of the field as BlankZero = yes in case of number fields. As you won’t perform a Modify in the report, there is no danger to “delete” the data in the database. Should look like this: IF NOT ShowAmount then Amount := 0;
Saludos Nils
I have written a few reports that use dynamically populated columns. To do this, simply remove the label controls and in their place, place text boxes with a variable source control (I use arrays but, you could use individual names). Then “hide” the columns by not giving the text boxes you are using as a “label”. Also use the blank/zero = Yes as stated above.