Now the report generator will filter data and display the data which the CategoryID is equal to keys specified in the fields in the list of the variable values. Closes this menu saving items and input keys.Īfter that, click the Submit button. Creates a new item with the field in which to specify a key The picture below shows an edited list of the variable: Now, when rendering a report, it is necessary to edit the list of values of the variable (remove unwanted items, or change the key in the item field, or create a new item) in the viewer window. The picture below shows an example the rendered report:Īdd a filter in the DataBand, where as the filter condition, specify the expression UNN.Contains(Categories.CategoryID). Create a variable type of List with the name UNN, and specify the column CategoryID as keys and values. When using this mode, selecting or entering values in the variable field will require from the user. This mode of the variable will be applied if the Request from User and Allow Users Values is enabled. The Reset button resets the current value and sets the first top value from the variable list. The picture below shows an example of a report with the selected value 4 : When clicking the Submit button, the report generator will filter data and display these data, which CategoryID is equal to the selected value. The picture below shows the variable panel in the report: The picture below shows a list of variable values:Īfter selecting the value, click the Submit button to apply the selected value or the Reset button to reset the initial value in the list. Now, when report rendering, the value from the list will be selected in the viewer window. The picture below shows an example of the rendered report:Īdd a filter in the DataBand, where the expression Categories.CategoryID = UNN is a filtering condition. Create the variable UNN, which will store a list of items from 1 to 8. If using this variable in the report, there may need some actions from the user for selecting values from a variable list. This mode of operation of the variable will be used if the Request from User parameter is enabled and the Allow Users Values is disabled. In this case, when rendering a report, no action will require from the user. The picture below shows an example of a report using a variable to filter data: In this case, it is the entry Condiments. Now when rendering a report, the report generator will consider the filtering condition and display only those entries which values in the column CategoryID be equal to the values, stored in the variable. The picture below shows an example of the rendered report:Īdd a filter in the DataBand, where specify the expression Categories.CategoryID = UNN as the filtering condition. Create a variable that will store the value 2 of the integer type with the name UNN. using a variable in the report, no action will require from the user. This mode will be applied if the Request from User parameter is disabled, i.e. Let us consider these modes in more detail. Set the following to the BeforePrint event handler of the DataBand:ĭataBand.Enabled = MyVariable1 (any expression of the bool type.Depending on the selected parameters the variable in the report can be operated in the following modes: autonomous, user (with selecting values), user (with inputting values). (CheckBoxControl2.Checked & (Customers.ContactTitle = "Sales Agent"))Ģ. (CheckBoxControl1.Checked & (Customers.ContactTitle = "Owner")) || The expression of the variable (or in the expression directly of the filter) should be set like this: Important: ReadOnly checkbox must be checked and the Function checkbox also must be checked when you defining the variable. MyVariable1 - it is the bool type variable that is defined in the report Dictionary. In the filter dialog window of the DataBand you should choose in the Field is combobox an Expression value and to type the following expression there: MyVariable1 You can achieve your goal in the following ways:ġ. Sandy wrote:I would like to, for example, be able to have 3 report parameters, but allow the user to choose "All" for 1 of them and have that filter not apply (or that filter return all values).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |