Category / Section
How to customize parameter setting by parameter name
Published:
Updated:
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>
<script>
$("#viewer").boldReportViewer({
beforeParameterAdd: "onBeforeParameterAdd"
});
</script>
</html>
<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");
}
}
</script>
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?