Sometimes you want to have a dynamic value entered for your report at run time. For example, you may want to input order date as an input parameter when running a report so that only orders on that date will be displayed. Typically, parameters are used as part of the query condition (search criteria) so that only records satisfying that parameter will be retrieved to become part of the report.
Reference Notes: For the usage of parameters, please refer to User's Guide | JReport Parameter and its Application.
There are three ways to insert a parameter:
- Using the Edit toolbar
Click Insert Parameter on the Edit toolbar in JReport main window. This will open the Insert DBField dialog with the Parameters tab shown. To create a new parameter, click New. To insert a parameter that already exists, select that parameter, and then click Insert. Move the cursor to a suitable position where you want to place the parameter, and then click the left button of your mouse.- Using menu commands
On the Insert menu, click DBFields. Switch to the Parameter tab To create a new parameter, click New. To insert a parameter that already exists, select that parameter, and then click Insert. Move the cursor to a suitable position where you want to place the parameter, and then click the left button of your mouse.- Using Resource Viewer
In Resource Viewer, all the parameters that can be used in the currently opened report are listed under the Parameters node. Select a parameter and drag it to the proper position in the report.Related Information:
User's Guide | Starting A Catalog | Setting Default Values for Objects
Using Catalog Browser
To create a new parameter, on the Data tab, select the Parameter node, right-click and on the pop-up menu, click Add Parameter. To edit a parameter that already exists, right-click a parameter under the Parameters node, and then select Edit Parameter.Using Resource Viewer
Select the Parameters node, right-click and on the pop-up menu click Add Parameter.Using the Edit toolbar and Menu
Go to the Parameter tab in Insert DBField dialog. To create a new parameter, click New. To edit a parameter that already exists, select that parameter, and click Modify.The Create Parameter dialog appears when you click the New button. If you click Modify, the caption of this dialog will be Edit Parameter and the Parameter Name field will be unchangeable.
![]()
- Parameter Name
Type a name for the parameter.- Value Type
Select a type for the parameter value, such as: Integer, Number, String, Currency, and so on.- Prompting Text
Screen text to prompt the user to provide correct information for this parameter.- Prompting Values
This is the default value for the parameter. The default value must be of the same type as the type selected in Value Type.
After you type a new value into the Prompting Values text box, click the plus button above the text box, the value will be added to the list.
When you click the cross button above the Prompting Values text box, the value in the it will be removed from the list.- Minimum Value
Input the minimum value (optional).- Maximum Value
Input the maximum value (optional).
Note: The prompting value you input must be between the minimum value and the maximum value, or an error message will appear.- User Defined Format
If you have defined the value format, for example, MMM-dd-yy, all the values you input should be consistent with it. Otherwise there will be an error message.- Bind with Column
JReport provides such a mechanism that link each field value of Display Column with the exact value of Bind Column. When you select the field value from Display Column, the field value of Bind Column is actually sent to the query and filter the query result.- Bind Column
The column name used to filter the data in the database.Display Column
When viewing a report which contains parameters, the field value associated with the column name you selected in the drop-down list of Display Column will display in the dialog popped up at runtime. You can select a value from the list to query data with the bound field.Distinct
If the Distinct option is checked, in the Enter Parameter Values dialog only identical values list instead of duplicate values.Required
If checked, you must supply a value before the report can run.
If not checked, you can either type a value, or leave it as it is. If you do not want to see this parameter in report, make sure the field is left blank.
For more information about parameters, refer to: User's Guide | JReport Parameter and its Application.
Draw Objects allows you to draw arches, ovals, boxes, round boxes and lines in your report, or to insert labels and images into your report.
- Inserting Labels
You can insert labels by using the Edit toolbar and Menu.
Using Edit toolbar: On the Edit toolbar, click the Insert Label button.
Using Menu: On the Insert menu, click Label.
After that, move your cursor to a suitable position in the design area where you want to place the label, and then click the left button of your mouse.To edit in the label text, double-click the label and edit the text in it. When you have done, click anywhere outside the label.
- Inserting Images
You can choose the image to be inserted from your own machine or from the internet.
To insert an image from your own machine,
- Copy the image to the directory where the catalog locates.
- On the Insert menu, click Image, or on the Edit toolbar, click Insert Image. The Insert Image dialog appears.
- Input the image name in the Image Name/URL text box, or click the Browse button to bring out the Select a Picture dialog to choose an image. You can preview the selected image on the right panel of the Select a Picture dialog.
- Click Open to choose the image and close the Select a Picture dialog.
- Click the Insert button. Move your cursor to a suitable position in the design area where you want to place the image, and then click the left button of your mouse.
To insert an image from the internet,
- On the Insert menu, click Image, or on the Edit toolbar, click Insert Image. The Insert Image dialog appears.
- Input the URL of the image to the Image Name/URL text box.
- If you want to see the specified image before inserting it into the report, click the Preview button and the image will be displayed in the Preview panel.
- Click the Insert button. Move your cursor to a suitable position in the design area where you want to place the image, and then click the left button of your mouse.
Note: The image types supported here are:
.gif,.bmp, and.jpg.- Inserting Arc, Box, Line, Oval and Roundbox
To insert a draw object, on the Insert menu, click Arc (or Box, Line, Oval, Roundbox), or click on the corresponding button on the Edit toolbar.
Then, move your cursor to a suitable position in the design area where you want to place the shape, left-click and drag the mouse to a proper position to form the shape, and then release the mouse button.