Using Telerik Report Parameters

Using Telerik Report Parameters

Fast-Weigh GraphQL & REST APIs

 
To add the API module to your Fast-Weigh subscription, contact us at 865-219-2980 or support@tacinsight.com.

Required Parameters

When building your reports within Telerik, you have the ability to link your GraphQL Where Clause directly to dynamic parameters within Telerik to filter your data. 

  1. Ensure that you have your Where Clause set up within your GraphQL Query.
 
Tip: For more information about GraphQL Where Clauses, check out our article on Using Parameters in GraphQL.
  1. When you copy your query Body over from Insomnia, it should auto-generate Telerik parameter connectors in your variables.
  2. Click Next to go to the Configure Request Parameters page. Here, you will see your auto-generated parameters.
    1. Make sure the Type is set to Inline for any Parameters that are passed to your GraphQL Body.
  3. Enter the values you want to use for the data preview in the Design-Time Value
  4. Set up the parameterized value in Value by selecting the drop-down > New Report Parameter (if you have pre-setup your parameter, just select it from the list).
  5. Setup the Telerik Parameter in the Report Parameter Editor pop-up 
  6. Some GraphQL Where clause formats will need to add extra formatting in your Value
    • Strings: Make sure your body does have quotes around the @variable in the Body.
    • Integers: Make sure your body does not have quotes around the @variable in the Body.
    • Dates: Make sure your body does have quotes around the @variable in the Body.
      • You will also need to add the following formatting to the Value expression to ensure that the date is in the correct Year-Month-Day format:
        = Format("{0:yyyy-MM-dd}", Parameters.NAME.Value )
    • String Arrays: Make sure your body does not have quotes and does have brackets around the @variable in the Body.
      • You will also need to add the following formatting to the Value expression to ensure that each value selected is wrapped in quotes and separated by commas:
        ='"' + Join('","', Parameters.NAME.Value ) + '"'
    • Integer Arrays: Make sure your body does not have quotes and does have brackets around the @variable in the Body.
      • You will also need to add the following formatting to the Value expression to ensure that each value selected is separated by commas:  
        =Join(',', Parameters.NAME.Value )
  7. Click Next to preview your data using the Design-Time Value, then click Finish.
  8. Navigate to the Home tab on the top of the report and click Preview to test your parameters.

Optional Parameters

In addition to Required Parameters that directly filter what is returned from your Data Source, you can also use Telerik by itself to create optional parameters and filters.

  1. Set up the parameter by right-clicking the white space on the report and then clicking Report Parameters...
  2. Add in a new Parameter in the Report Parameter Editor pop-up 
  3. Click OK to close the pop-up.
  4. Right-click the report white space again and this time select Filters...
    Note: you can also use Filters for simple data filters like filtering out all voided tickets.
  5. Add a new Filter that you will map to your new Report Parameter
    • Since we want this parameter to pull in everything when blank or filter to one customer when filled out, we will need to add in more to the expression than a simple filter.
  6. Under the Expression side of the filter editor, click on the drop-down arrow and select <Expression>
  7. Click in the text box after the equals sign
  8. Navigate to Functions > Logical and double click IIf to add it into the text box above. (You can also manually type this instead of pulling it in from Functions) 
  9. Begin the conditional IIf statement with a check to see if the parameter is blank.
    1. Add in the parameter value by Navigating to Report Parameters > click the + by the parameter name > double click Value
      Note: Here, we are adding Parameters.CustomerID.Value
    2. In the text box, click between the end of the Value and the parenthesis and add in an equal sign and an empty quote:
      = ""
    3. This completes the check to see if the parameter is blank.
  10. Click in the text box after the empty quotes and add a comma to begin the truePart of the IIf statement.
    1. Note: Here, we want nothing to happen if the expression is true (the parameter is blank).
    2. Add in another empty quote:
      ""
    3. This completes the truePart of the IIf statement.
  11. After the truePart, add another comma to begin the falsePart.
    1. Navigate to Fields and double-click on the field you want to populate if the parameter is not blank (what it will be matching).
 
Note: Here, we want the Customer ID to populate if the expression is false (the parameter is not blank).
    1. This completes the falsePart of the IIf statement.
  1. Click OK to close the Expression Editor.
  2. Under the Value side of the filter editor, click on the drop-down arrow and select the Parameter.
  3. This completes your entire optional filter. Go ahead and close the Filter Editor.
  4. Navigate to the Home tab on the top of the Report Designer and click Preview to test out the report.
    • You should be able to leave your new parameter blank (you may have to click inside of the field and then click out in the report designer so it registers and blank) or type in a value to filter the report to that single value


    • Related Articles

    • Connecting GraphQL to Telerik Report Designer

      Fast-Weigh GraphQL & REST APIs To add the API module to your Fast-Weigh subscription, contact us at 865-219-2980 or support@tacinsight.com. Note: Make sure you are running Telerik Report Designer version 14.0.20.219 or later. Navigate to the Data tab ...
    • Using Parameters

      Fast-Weigh GraphQL & REST APIs To add the API module to your Fast-Weigh subscription, contact us at 865-219-2980 or support@tacinsight.com. Using Parameters Parameters allow you to pass data into your GraphQL statement. Common parameter types Int ...
    • Telerik Report Formatting

      Fast-Weigh GraphQL & REST APIs To add the API module to your Fast-Weigh subscription, contact us at 865-219-2980 or support@tacinsight.com. Here are some additional walkthrough videos on tools you can use within Telerik to Style your reports ...
    • Helpful Telerik Links

      Fast-Weigh GraphQL & REST APIs To add the API module to your Fast-Weigh subscription, contact us at 865-219-2980 or support@tacinsight.com. Telerik Support Page Telerik Designing Reports Knowledge Base Telerik Reporting Forum Getting Started with ...
    • Handling Nullable Tables in Telerik

      Fast-Weigh GraphQL & REST APIs To add the API module to your Fast-Weigh subscription, contact us at 865-219-2980 or support@tacinsight.com. Sometimes, you may have a table linked in your GraphQL query that can be set or completely blank depending on ...