3 Answers, 1 is accepted
The HTML5 Report Viewer exposes all its available commands through the commands collection.
Each command is an object, with the exec() method being the one that actually triggers the command. The other two methods, enabled() and checked() return a bool value and can be used prior to executing a command or to find in what state the UI for the command should be.
The toggleParametersArea shows or hides the parameters area and can be used in the described scenario to check if the parameter area is already enabled or not:
var
reportViewer = $(
"#reportViewer1"
).data(
"telerik_ReportViewer"
);
if
(reportViewer.commands.toggleParametersArea.checked()) {
reportViewer.commands.toggleParametersArea.exec();
}
Regards,
Nasko
Telerik
In TRDP report ,toggle parameter area is always disable .how it will enable
I am using telerikReportViewer.js
How it will fixe....any idea??

I found .hasClass on the ParametersArea div to be a more reliable way of checking. I kept getting inconsistent results back with the .checked() on the command object.
$(
"#reportViewer1"
)
.telerik_ReportViewer({
serviceUrl:
"/api/reports/"
,
viewMode:
"INTERACTIVE"
,
scaleMode:
"SPECIFIC"
,
reportSource: {
report: reportClass,
parameters: {
CultureID:
"en"
}
},
renderingEnd:
function
() {
if
($(
"div[data-role$='_ParametersArea']"
).hasClass(
"hidden"
))
this
.commands.toggleParametersArea.exec();
}
});

Hopefully this will help somebody when trying to hide / show the parameters area of a report. This is working when you're using a model
$(document).ready(function() {
$("#webReportViewer").telerik_ReportViewer({
serviceUrl: "/api/report",
viewMode: "INTERACTIVE",
scaleMode: "SPECIFIC",
reportSource: {
report: "@Model.ReportType@Model.ReportName\.trdp",
parameters: {
FromDate: @Model.FromDate,
ToDate: @Model.ToDate,
Extension: @Model.Extension,
TalkTime: @Model.TalkTime
}
},
renderingEnd: function() {
if (!$("div[data-role$='telerik_ReportViewer_ParametersArea']").hasClass("k-state-collapsed")) {
this.commands.toggleParametersArea.exec();
}
}
});