Skip to Content

Parameterized Report

fb-share
download

Hi, my name is Kumar, and in this video I will demonstrate how to create report with parameters.

For that, let us go to iVend Management Console. In Management Console, go to Reports. Under Menu Designer Label, select option Report Designer. Report Designer Screen appears. Let us start with creating a simple report first. Go to the Data Band, provide the Data Source. This is the table. Let us take few columns like ID, Description, Okay. Select the Data Source and then Okay.

Put the Text Component, Data Column, let us align them. So, this is simple list report prepared.

Now, we will add parameters to this report template. The parameters in the report are implemented using variables. Please note, a variable may have different values.

Now, to add a variable, go to Dictionary tab, then right click and select option, New Variable. Window appears to create new variable, change the name, let us keep it Product, then Alias. You can specify the description if necessary, then choose the type of stored value will be String in our case and the type of variable. We will approach the value type variable.

Here is a very important step which we have determined that our variable will store a single value rather than a list of values of range and this value will be stored in a string type. Then, set the default value. Make sure, Request Form User and Allow User check boxes are not checked. So, uncheck them. Then, click Okay.

Now, let us define the Parameters. For that, select Data Source and then right click and click on Edit. Edit Data Source window appears. Here, create a new parameter by clicking the New Parameter button in the query window.

After clicking this button, a new parameter will be created. This parameter will be displayed in the Parameter tab in the Column Panel. Here, parameter properties can be changed or edited. The name property used to change the parameter name. This feature works only for name parameters. Let us give it a name.

For each parameter, you can specify a value that is used to populate the parameters. The value can be an expression, constant, variable, etc. Click on Browse button in Expression. Here, assign the variable to the parameter which we created earlier. So, double click on variable which is product in our case and then click Okay.

Then, define the size according to your filter variable. The Size property provides an opportunity to change the size of the type used in the parameter. Keep in mind that each column has its own size; therefore, when using a query you must specify the correct type size. Let us give it some size. Then, select the Type. Use the Type property in order to change the parameter type. The values of properties are in dropdown list and our list of types used in the parameter for a particular database.

For String, let us select NVarChar. You must specify the parameters in the query. So, in Query Box, we will define the parameter. Please note, parameter should be assigned with @ sign as a prefix in query.

After this, click Okay and now let us save this report. Click Okay, Save this report, give some name, and Save it.

Now, to import this saved report in iVend, go to Administration, let us expand this. In Administration, under Application Setup menu, select Report Manager. Here click on New. Provide the Description for this report. This will be Product Report. Then, provide the path for the saved report. Select the report. If you want, you can provide the Report Group Type. Let us keep it in General Report and click Okay. 'XML file is not selected. Do you want the system to generate it automatically,' say Yes, and this is imported in iVend.

Now, let us run this report. Let us close it. We need to restart the Management Console. Now, let us go to Report section. In General section, search for our report which is Product Report, and you can see the parameter we defined in that report is here. Click on the Browse button, and you will have the Product Search window here. Search for the product, let us say 271.

So, in this way, you can design the reports with parameters.

With this, we end our session.

Thank you for watching this video.