This is a migrated thread and some comments may be shown as answers.

Cannot pass parameters

4 Answers 168 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Yoly
Top achievements
Rank 2
Yoly asked on 28 Apr 2009, 03:56 PM

Hi.
 
 After upgrading to Q1 2009 of Reporting I cannot send the parameters to the report.
 
My code is as follows:

        Dim report_generalAudit = New ReportsCL.GeneralAuditReport
        report_generalAudit.DataSource = resultsDataTable

        Me.viewer.Report = report_generalAudit

        Me.viewer.Report.ReportParameters("StartDate").Value = startDate
        Me.viewer.Report.ReportParameters("EndDate").Value = endDate 
  
  I get the following exception:
  
  Input string was not in a correct format.
  
  on
   Me.viewer.Report.ReportParameters("StartDate").Value = startDate

   
Am I doing something wrong?

Thanks in advanced.
  

4 Answers, 1 is accepted

Sort by
0
Yoly
Top achievements
Rank 2
answered on 28 Apr 2009, 04:10 PM
With a little bit more poking around I found that   Me.viewer.Report.ReportParameters(0).Value = startDate

DOES work.

So instead of
Me.viewer.Report.ReportParameters("ParameterName").Value = startDate
we have to use
Me.viewer.Report.ReportParameters(0).Value = startDate


So with Q1 2009 passing parameters with name as was done previously is broken also? 
0
Steve
Telerik team
answered on 29 Apr 2009, 10:38 AM
Hello yceron,

There is no such problem and I've just tested this with a sample project, that I've attached here for your convenience.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Yoly
Top achievements
Rank 2
answered on 29 Apr 2009, 01:34 PM
Thank you Steve for your response.

While the code you provided indeed does work please note that the code I posted passes the parameters through the viewer object and it doesn't work anymore:

        Me.viewer.Report.ReportParameters("StartDate").Value = startDate

The code you provided passes the parameters to the report object, not the viewer:

           Dim report As Telerik.Reporting.Report = Me.ReportViewer1.Report
           report.ReportParameters("MyParam").Value = query


I just find odd that this breaking change was made and wasn't documented on the release notes (I couldn't find it anywhere).  I had over 10 reports on my application working this way and got stuck yesterday when I upgraded to the Q1 2009 version and everything got broken and I couldn't find this change documented anywhere.  I really hope that in the future these changes are better documented so upgrading to a new version isn't such a painful process.

Again, thank you very much for your help.
0
Steve
Telerik team
answered on 29 Apr 2009, 02:35 PM
Hello yceron,

Actually both breaking changes are reflected in our release notes here (check the bottom of the article) and explained in details in separate KB articles. Here is the KB article for the change you've hit - ReportViewer.Report property is now of type Telerik.Reporting.IReportDocument.
I've kind-a skipped quickly through your first post and looked directly at your second post where you claim that the problem is with the index - whether it is the name or the exact index specified, which should not matter at all in this case.

Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Yoly
Top achievements
Rank 2
Answers by
Yoly
Top achievements
Rank 2
Steve
Telerik team
Share this question
or