Hi,
What I require is to be able to pass parameters to a report that don't exist as part of the actual report viewer control. In other words, I need to be able to ask the user for information in a form and then post that information to the report viewer further down the page.
I've managed to get this working by using the following javascript in the click event of my form button:
I can see that the POST actions in Firebug are as follows when the number "1" is entered into the text box outside the viewer:
The problem is, the query that's generated against the database to return results passes in a 'NULL' value to set against the parameter "@portfolioId".
What am I doing wrong?
Cheers.
What I require is to be able to pass parameters to a report that don't exist as part of the actual report viewer control. In other words, I need to be able to ask the user for information in a form and then post that information to the report viewer further down the page.
I've managed to get this working by using the following javascript in the click event of my form button:
$(
'#btnUpdateReport'
).click(
function
() {
// add the parameters to the controller parameters
var
pId = $(
'#txtPortfolioId'
).val();
var
viewer = $reportViewer.data(
'telerik_ReportViewer'
);
viewer.reportSource($.extend({}, viewer.reportSource(), { parameters: {
'portfolioId'
: pId } }));
});
I can see that the POST actions in Firebug are as follows when the number "1" is entered into the text box outside the viewer:
/api/reports/clients/142151-0f94/ReportingPrototype.Reports.InvestmentStrategy, ReportingPrototype/parameters?{"portfolioId":"1"}=
/api/reports/clients/142151-0f94/instances?{"report":"ReportingPrototype.Reports.InvestmentStrategy, ReportingPrototype","parameterValues":{"portfolioId":1}}=
The problem is, the query that's generated against the database to return results passes in a 'NULL' value to set against the parameter "@portfolioId".
What am I doing wrong?
Cheers.