Bold Reports FAQ

Find answers for the most frequently asked questions

⮜ Back

How to customize parameter setting by parameter name

Use the beforeParameterAdd event for this customization. You can refer the following code sample for customizing the parameter setting by StartDate and EndDate parameter name.

<div id="viewer"></div>
              beforeParameterAdd: "onBeforeParameterAdd"
      <bold-report-viewer id="viewer" report-service-url="/api/ReportViewer" report-path="product-line-sales.rdl" before-parameter-add="beforeParameterAdd"> </bold-report-viewer>
       <script type="text/javascript">
       function beforeParameterAdd(args) {
           if (args.parameterModel.Name === "StartDate") {
               args.parameterSettings.minDateTime = new Date("4/5/2003 5:00:00 AM");
               args.parameterSettings.maxDateTime = new Date("4/15/2003 5:00:00 AM");
            if (args.parameterModel.Name === "EndDate") {
               args.parameterSettings.minDateTime = new Date("5/10/2003 5:00:00 AM");
               args.parameterSettings.maxDateTime = new Date("5/20/2003 5:00:00 AM");

See also

How to add the Null parameter with DatePicker for DateTime parameter?

How to group the values in parameter drop down?

How to customize the boolean parameter UI with parameter pane?