Articles in this section
Category / Section

How to Render Reports with a Specific Date Interval in Bold Reports

Published:
Updated:

In Bold Reports, efficiently managing date intervals can significantly enhance user experience and report functionality. By implementing a feature that hides report rendering when the date range selected by users exceeds a predefined limit, you can ensure users are guided to select appropriate filters. This Knowledge Base (KB) provides step-by-step instructions on how to achieve this functionality and implementation details. Some of the benefits of this include limiting the date range helps manage data load and ensures reports focus on relevant data segments. The warning message prompts users to adjust their date filters for a more manageable report size.

Follow the steps below to achieve this requirement:

  1. Add two datetime parameters named “FromDate” and “ToDate” to capture the desired time intervals from users.
    image.png

    image.png
  2. In the report header, insert a text box and add an expression to display a warning message if the selected date interval exceeds the limit. Use the following expression:
    image.png
=IIF(DateDiff("d", Parameters!FromDate.Value, Parameters!ToDate.Value) > 30 ,"Since the date interval is more than 30 days. Change the parameters to get the data.","")
  1. Design the report layout as required and set its visibility based on the date interval selected by users. In the example, the report is designed with a simple textbox report item.

    image.png

  2. Set the visibility for the textbox report item using the following expression:

    image.png

    image.png

=IIF(DateDiff("d", Parameters!FromDate.Value, Parameters!ToDate.Value) > 30 ,True,False)
  1. Save and preview the report.

In our example, if a user selects a data interval exceeding 30 days, an error message will be shown in the header expression. If the user selects a date interval within 30 days, the report will render.

Output:

Within 30 days date interval

image.png

Exceeding 30 days date interval
image.png

For your reference, the sample report is also attached here.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied