Friday, 20 May 2011

Default a Report Parameter in Moorgate

Moorgate has application wide filtering on an account level so defaulting and disabling the Report parameters does not make sense since you generally want to run a report on a larger dataset. You can default certain parameters if needed by ensuring they are named as follows in the RDL (case is important):
UserID
ProductCompanyID
ProductID
FundCompanyID
FundID

There are requirements however to ensure that a user can only run Reports for Product Companies to which they are assigned. This can be done as follows:

  1. Right click outside of the Report in the layout tab to open the Report parameters box
  2. Create a Parameter with the name UserID  in the Report and return a list of active users in the Database to populate it in the available values 
  3. Make this parameter 'Hidden'
  4. Make your Product Company parameter dependent on the UserID
The Report User Parameter then 'matches' to the application UserID and defaults to the logged in value, ensuring the Product Company dropdown is filtered correctly. It is hidden so the user cannot change it, thus disabling it.

Only the text and case of the Parameter names in the RDL is important. It doesn't matter what the Label is, or the name of the parameters in the Datasets.


No comments:

Post a Comment