Limit the Number of Records per Page

media_1449123804215.png

To add a parameter to the report, in the Field List, right-click the Parameters section, and in the invoked menu, choose Add Parameter.

media_1449123852226.png

Select the parameter, and in the Property Grid, set its Description to Rows per Page:, Parameter Type to Int32 and (Name) to rowsNumber.

media_1449123891152.png

From the Toolbox, drop the Page Break control onto the report’s Detail band and place it at the top of the detail table.

media_1449123926785.png

For the created control, set the Visible property to No, and for its Formatting Rules property, click the ellipsis button, to invoke the Formatting Rules Editor.

In this dialog, click the Edit Rule Sheet… button. The Formatting Rule Sheet Editor will appear.

media_1254894490132.png

Now, click the Add button , to create a new formatting rule. Then, set its Visible property to Yes, and for the Condition property, click the ellipsis button, to invoke the Condition Editor.

media_1254894527946.png

In this editor, define the following expression for the rule: ([DataSource.CurrentRowIndex] % [Parameters.rowsNumber] == 0) And ([DataSource.CurrentRowIndex] != 0).

Click OK, to save the changes and close the dialog. Then, click Close to quit the Formatting Rule Sheet Editor.

media_1449123941784.png

Now, in the invoked Formatting Rule Sheet Editor, click + , to create a new formatting rule.

Set its Visible property to Yes, and click the ellipsis button for its Condition property.

media_1449123962877.png

In the invoked Condition Editor, define a logical expression for the rule, (e.g. ([DataSource.CurrentRowIndex] % [Parameters.rowsNumber] == 0) And ([DataSource.CurrentRowIndex] != 0)).

To save the changes and close the dialog, click OK.

Then, click Close, to quit the Formatting Rule Sheet Editor, as well.

media_1449124041327.png

To save the changes and close the editor, click OK.

media_1254894573757.png

Count the Number of Records in a Report or a Group

Count the Number of Records in a Group

media_1449123589201.png

Set the Running option to Group and the Function to Count.

The Ignore NULL values option is useful for functions like Count or Average, because the number of elements counted will depend on it.

If required, you can specify the Format String (e.g. as Units Count: {0}). Note that value formatting is applied to a summary independently of the general formatting, and has a greater priority.

Count the Number of Records in a Report

media_1449123675971.png

To add a Report Footer band to your report, right-click anywhere on it, and in the invoked Context Menu, choose Insert Band | ReportFooter.

media_1449123707889.png

Then, place a Label bound to a data field onto it, and in the Property Grid, expand its Summary category.

Set the Running option to Report and Function to Count.

The Ignore NULL values option is useful for functions like Count or Average, because the number of elements counted will depend on it.

If required, you can specify the Format String (e.g. as Total Count: {0}). Note that value formatting is applied to a summary independently of the general formatting, and has a greater priority.

media_1449123766563.png

Add a Cross Reference

media_1449123413464.png

Drop a label onto the created ReportHeader band, which will serve as the report’s headline.

Click the label, to type the desired contents into it. Then, in the Property Grid, set its Name property to reportTop.

media_1449123446723.png

To accompany the existing Group Header with the corresponding Footer, in the Group and Sort Panel, check the Show Footer option.

Then, drop a label onto it. As it will be the link, change its Text to Top of Report, and apply the desired formatting to it (e.g. the blue color and underlined text).

Set its Navigation Target property to _self. Then, if you click the drop-down list of the Navigation URL property, you can see the controls available in your report. Choose the one named reportTop.

media_1449123507998.png

The cross-reference is now ready. Switch to the Preview Tab, and view the result.

Create Hyperlinks

media_1449123350028.png

Drop a Label onto the report, and in the Property Grid, change its Text to the one required for the link.

media_1449123388322.png

Now, set its Navigation Target to the required value (_blank, _parent, _search, _self, or _top), and define the required Navigation URL.

Add Bookmarks

media_1449123140059.png

Click the Label in the Report Header band, to select it, and in the Property Grid, set its Bookmark property to the same value as its text (i.e. Products by Categories).

media_1449123205771.png

Now, select the Label in the report’s Group Header band.

As this control is bound to data, we will bind its Bookmark property to the same data field, using the (Data Bindings) property.

Note that as with other bindable properties, you also can apply value formatting to the Bookmark property (e.g. Category {0}).

media_1449123245536.png

Then, for this Label, specify its Bookmark, and set the Parent Bookmark property to the Report Header’s label, to define the document map’s hierarchy.

media_1449123308965.png

The report with bookmarks is now ready. Switch to the Preview Tab, and view the result.

Conditionally Change a Label’s Text

media_1254891659406.png

To create a calculated field, in the Field List, right-click any item inside the created dataset, and on the invoked menu, choose Add Calculated Field.

media_1449121699914.png

Now, in the Property Grid, set the field’s Field Type property to String. Then, locate its Expression property and click its ellipsis button. The Expression Editor will appear.

In this dialog, define the required condition for the calculated field (e.g. Iif([UnitsOnOrder] == 0, ‘None’, [UnitsOnOrder]), which means that if the UnitsOnOrder data field’s value is equal to 0, the appropriate control’s text will be replaced with None).

To close the dialog, click OK.

 

media_1449121740851.png

Finally, drop the required data fields (and the created calculated field as well) from the Field List onto the report’s Detail band.

media_1449121760042.png

The report is now ready. Switch to the Preview Tab, and view the result.

Conditionally Hiding Bands

media_1254891182386.png

In this example, we will hide the Group Header and Detail bands, if a grouping field meets a certain condition. Note that no scripts are required to accomplish this task.

Add a Group Header band to the report.
For this, right-click anywhere over the report’s surface, and in the invoked Context Menu, point to Insert Band and click GroupHeader.

media_1254891199182.png

Drop a field which will be used as a grouping criteria, from the Field List onto the created GroupHeader1 band.

media_1449121385538.png

Select the Group Header, and click its Smart Tag.

Then, in the invoked actions list, click the ellipsis button for the Formatting Rules option.

In the invoked Formatting Rules Editor, click the Edit Rule Sheet… button.

media_1449121471974.png

Now, in the invoked Formatting Rule Sheet Editor, click the button, to create a new rule.

Then, set its Visible property to No, and click the ellipsis button for the Condition property.

media_1254891297455.png

Now, select the Group Header band’s strip, and in the Property Grid, locate the Formatting Rules property, and click its ellipsis button.

In the invoked Formatting Rules Editor, click the Edit Rule Sheet… button.

media_1449121510564.png

Construct the required logical expression (e.g. [CategoryID] < 2), and click OK.

media_1254891553528.png

Back in the Formatting Rules Editor, move the created rule to the dialog’s right section (Applied Rules), to make it active.

And, do the same for the report’s Detail band. That is, click the ellipsis button for its Formatting Rules property, and in the invoked dialog, apply the same rule to this band, as well.

media_1449121606579.png

Switch to the Preview Tab, and view the result

Conditionally Change a Control’s Appearance

media_1449121352995.png

Drop the required fields from the Field List onto the report’s Detail band.

media_1449120986968.png

Select the report by clicking anywhere over the blank area around its bands, and in the Property Grid, locate the Formatting Rules Sheet property and click its ellipsis button.

The invoked Formatting Rule Sheet Editor is intended to manage and customize formatting rules, which then can be defined for the report’s bands and controls.

In this dialog, create a new formatting rule (by using the button), locate its Condition property and, again, click its ellipsis button.

media_1449120972153.png

In the invoked Condition Editor, define the required Boolean condition. In this tutorial, we will format fields if the UnitPrice value is greater than 30.

To save the condition and close the dialog, click OK.

media_1449121019881.png

Now, back in the Formatting Rule Sheet Editor, define the formatting to be applied (e.g. specify the desired font color).

To save the changes and quit the dialog, click Close.

media_1449121067602.png

Select the band or control to which the formatting rule must be applied (in this example it is the Detail band), and in the Property Grid, locate its Formatting Rules property and click its ellipsis button.

 

media_1449121115117.png

If multiple rules are applied, it is possible to customize their precedence, by using the up and down arrow buttons at the right of the dialog.

So, the rules are applied in the same order that they appear in the list, and the last rule in the list has the highest priority.

media_1449121173998.png

 

 

Store and Restore Style Sheets

media_1449120561134.png

Click the report’s Smart Tag, and in the invoked actions list, locate the Style Sheet property and click its ellipsis button.

media_1449120828632.png

In the invoked Styles Editor, use the button, to create new styles.

Define their required properties and click the Save button.

In the invoked Save File dialog, define a name for the style sheet file (.REPSS) to be created and click Save.

Now, in the Styles Editor dialog, use the Delete button to delete the created styles, and close the dialog.

 

media_1254890256764.png

Select the report, by clicking anywhere over the blank area around its bands. In the Property Grid, locate the Style Sheet Path property and click its ellipsis button.

In the invoked Open File dialog, load the created REPSS file.

If you then click the Style Sheet properties ellipsis button, in the invoked Styles Editor, you’ll see that the properties of the styles are read-only. This is because we used the Style Sheet Path property to load the style sheet.

If the Style Sheet Path property is then set to None, and a style sheet is loaded into a report using the Style Sheet property, all the styles loaded from the style sheet file will still be kept in the report, but become editable.

media_1449120876655.png

When you invoke the Styles Editor (via the report’s Style Sheet property) again, you’ll see that the styles are read-only, meaning that they are obtained from an external file.

If the Style Sheet Path property is then set to None, and a style sheet is loaded using the Styles Editor of the Style Sheet property, all these styles will become editable.

Using Odd and Even Styles

media_1449121930378.png

Add a Table to the Detail band.

media_1449121826736.png

Select the detail table, and in the Property Grid, expand its Styles.

Invoke the drop-down list for the Even Style, and click (New).

media_1449121834111.png

Now, expand the Even Style property, and adjust the required options, e.g. set the Background Color to ControlLight.

If required, perform the same steps, to create and assign an odd style, as well.

media_1449121840206.png