This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Filtered by Parameter in Report

Greetings,

I am in the process of creating reports with various parameters such as company or Employee Type or Employee Status. I would like to display the Parameter values in the Header of the report that were selected by the user when executed.

Example:  I have a report with a Parameter for Company and a parameter for Employee type. If the user selects Company "ABC"  and "XYZ" in the parameters and Employee type = "Contractor", Then I would like to display these user selected Parameter values in the header band so that it would display a field for Company Filter = ABC,XYZ and Employee Type filter = Contractor along with Report Scheduled by: John Doe.

Person Report Mock up

Report Scheduled by John Doe
Company ABC,XYZ
Employee Type Contractor
Company Employee Type First Name Last Name Status
ABC Contractor User1 Lastname1 Active
ABC Contractor User2 Lastname2 Active
XYZ Contractor User3 Lastname3 Inactive
XYZ Contractor User4 Lastname4 Inactive

====================================================================================

 Note: I do see that there is a "FIltered by" parameter built into the templates but I am unsure how to use this parameter or the syntax. I looked at other standard reports and the forum but was unsure of the functionality as I am using a VI_Reporting_Template_landscape_Params that has this "Filtered by" parameter.

Is there a forum discussion or documentation that would help explain this functionality for displaying the parameter values?

Thank you,

Parents
  • The report template VI_Reporting_Template_Landscape_Params (as well as the portrait one) contain the filtered by parameter just as a sample to demonstrate some possible options to use for displaying the parameter values.

    In this particular case, the value comes from a report internal variable called FilterValue (I've highlighted this variable in the dictionary with yellow). The content of this variable will be calculated in the BeginRender event of the report.

    The code demonstrates how-to iterate of the data source FilterListObjects to build a semicolon-separated string of entries of this data source. In older releases of the report engine we are using, you had to do it that way.

    Nowadays you would use the built-in function Func.EngineHelper.JoinColumnContent to achieve the same.

    {Func.EngineHelper.JoinColumnContent(DataSourceName, "ColumnName",Delimiter)}

    If you take a look at the screenshot from the dictionary again, you will see that the report parameters are available as variables as well (highlighted in green).

    So, if the value of the parameters allows doing that (for example no UIDs but human readable values) you can use them directly in the report by specifying them as an expression in your text box.

    {VariableName}

  • Hi Markus,

    Thanks again for the feedback and examples. I attempted to display the parameter value selected by using the {VariableName} as field in my report header. The only issue is that if my variable is set to multivalue, then it displays all the selected values without a separator or delimiter. How would I use the {Func.EngineHelper.JoinColumnContent(DataSourceName, "ColumnName",Delimiter)} functionality to accomplish this? I tried several ways to display this but was not entering the correct syntax.

    Example: I created a field in my report can called it 'Filtered by'  and then the field next to it holds the value for  {company] which is my variable for @company. I selected company ABC and XYZ since this is multivalued parameter. The output of the report for the "Filtered by' is ABCXYZ with no spaces. What is the correct syntax to display {company] as ABC, XYZ with a delimiter?

    Thank you

  • Thing is, that multi-value parameters are using char(7) as the delimiter between the values. So using the built-in replace function from the report should do the trick. The sample is assuming you are using VB as report language.

    {Replace(VariableName,System.Convert.ToString(System.Convert.ToChar(7)),", ")}

  • Hi Markus,

    This worked fantastic and resolved the issue with separating the multi-value parameter output in my report header. Really appreciate all your help and feedback as you have been so helpful with all my requests.

    Thanks

Reply Children
No Data