Parametrized Reports
When it is necessary to pass data of a certain type to a report (e.g., to pass a specific value to its filter string or a calculated field), you can avoid writing any code by utilizing parameters.
 
Passing Parameter Values to Your Reports
You can create parameters both of standard types (listed in the System.Type enumeration) and of your own custom types (such as enumerations or XPCollection objects).
When a report's Print Preview is shown, the Parameters panel automatically creates editors for each visible parameter, appropriate to its type (e.g., text boxes for string parameters and drop-down lists for Boolean values).

The capability to provide custom editors for report parameters is preserved in all platforms supported by XtraReports.
In LightSwitch, parameter values can be passed directly from LightSwitch queries to reports.
Alternatively, you can pass a parameter's value silently (without prompting your end-users to submit it) and hard-code this value by yourself.
For a parameterized report, you can also choose whether a report document is shown immediately using the default parameter values, or it is rendered only after submitting parameter values by an end-user.
Using Report Parameters
After a parameter is created, added to a report's collection and assigned its value, it can be used in different ways during report generation. For example, you can bind report controls to a parameter...

...or filter your report based on a parameter's value...

...or refer to report parameters in a calculated field's expression.

This extreme flexibility with the use of parameters allows you to create the most complex reports without the need to write any code.
To learn more about various data shaping capabilities available in the XtraReports Suite, see Shaping Data.
|