Add a Request Page option

Because we have defined the default sort sequences (DataItemTableView), except for the first DataItem, and we have not defined any Requested Filters (ReqFilterFields), the default Request Page for our report has only one DataItem FastTab. Since we have not defined any processing options that would require user input before the report is generated, we have no Options FastTab.

Our goal now is to allow the user to optionally input text to be printed at the top of the report. This could be a secondary report heading, instructions on interpreting the report, or some other communications to the report reader. To add this capability, perform the following steps:

  1. Open Report 50001 in the C/SIDE Report Designer.
  2. Access the C/AL Globals screen through View | C/AL Globals.
  3. Add a Global Variable named UserComment with a DataType of Text. We will not define the Length field as shown in the following screenshot; this will allow the user to enter a comment of any length:
  1. Add this variable as a data Column to be passed to Visual Studio. The Column must be subordinate to DataItem. We do not need a caption defined as we will use the variable name for this field in the report layout as shown in the following screenshot:
  1. Access the Request Options Page Designer through View | Request Page.
  2. Enter three lines-- Container, Group, and Field--with the SourceExpr of User Comment.
  3. Exit the Page Designer:
  1. Access Visual Studio through View | Layout.
  2. Add a Text Box to the Layout design surface just below the Report Title, stretching the box out as far as the report layout allows.
  3. Expand the DataSet_Result in the Report Data panel.
  4. Drag the User Comment field to the new text box as shown in the following screenshot:
  1. Save the RDLC and exit Visual Studio; then save, compile, and exit the Report Designer.
  2. Run Report 50001.

In the Request page, the user can enter their comment, as shown in the following screenshot:

The report heading then shows the comment in whatever font, color, or other display attribute the developer has defined:

Because we did not specify a maximum length on our User Comment field, we can type in as much information as we want. Try it; type in an entire paragraph for a test.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset