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

Report upgrade to 6.2.13.110 causing design/parameter problems

6 Answers 160 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 26 Jan 2013, 02:17 AM

Hi,

Couple of issues.

I installed reporting using and upgraded the project using the wizard.

When I try to open a report in design mode I get the problem shown in capture2.jpg which is trying to find a prior versioned dll.

Also one of reports has parameters that the viewer prompts for at runtime. the report will take the parameter but the following code that has always run in the past no longer runs:

private void RptADASummary_ItemDataBinding(object sender, EventArgs e)
 {
     if (txtStartDate.Value == string.Empty)
     {
         SchoolMonth _schoolMonth = SchoolMonthService.GetByID(Int32.Parse(this.ReportParameters["SchoolMonthID"].Value.ToString()));
         txtMonthNumber.Value = _schoolMonth.SchoolMonthNumber.ToString();
         txtStartDate.Value = _schoolMonth.StartDate.ToShortDateString();
         txtEndDate.Value = _schoolMonth.EndDate.ToShortDateString();
     }
 }

specifically it says the "this.ReportParameters["SchoolMonthID"].Value" is null.  This code has always compliled and run fine until the most recent upgrade.  has anything changed how one can access parameters in the report? If I take out the contents of this function, the report runs fine but is missing the text boxes.  see capture1.jpg

Thanks,

Jonathan

6 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 29 Jan 2013, 08:32 AM
Hi Jonathan,

The recommended approach to access the report parameters processing values in events is shown in the following code snippet:

private void RptADASummary_ItemDataBinding(object sender, EventArgs e)
 {
     if (txtStartDate.Value == string.Empty)
     {
         var report=(sender as Telerik.Reporting.Processing.Report);
         SchoolMonth _schoolMonth = SchoolMonthService.GetByID(Int32.Parse(report.Parameters["SchoolMonthID"].Value.ToString()));
         txtMonthNumber.Value = _schoolMonth.SchoolMonthNumber.ToString();
         txtStartDate.Value = _schoolMonth.StartDate.ToShortDateString();
         txtEndDate.Value = _schoolMonth.EndDate.ToShortDateString();
     }
 }

You may find useful the Using Report Parameters programmatically help article.

Greetings,
Peter
the Telerik team

HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Peter
Telerik team
answered on 30 Jan 2013, 08:50 AM
Hi Jonathan,

Up to design time question, the upgrade wizard should handle all of the Telerik.Reporting version dependencies. If you have go through the upgrade wizard, our suggestion is to close all designers and rebuild the project. Additionally check out the report's resource files for version dependent records. 

If you still experience difficulties with the design mode we will appreciate if you send us the problematic report definitions in a support thread to review on our end.

Kind regards,
Peter
the Telerik team

HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Jonathan
Top achievements
Rank 1
answered on 31 Jan 2013, 02:18 AM
Ok great
all is well thanks!
0
Khalid
Top achievements
Rank 1
answered on 05 Feb 2013, 09:45 AM
dear sir,
silverlight B A
we have the same problem but in case sent parameter from page :
the code in page 
void ReportViewer1_RenderBegin(object sender, Telerik.ReportViewer.Silverlight.RenderBeginEventArgs args)
        {
            if (args.ParameterValues.Count == 0)
            {
                args.ParameterValues.Add("PDocumentNo",documentId);
                args.ParameterValues.Add("PDocumentActionDate", dateAction);
                args.ParameterValues.Add("PDocumentType",cboDocumentTypeId);
                args.ParameterValues.Add("PDocumentClassification", cboDocumentClassificationId);
                args.ParameterValues.Add("PDocumentTitle", documentTitel);
                args.ParameterValues.Add("PDocumentImportance", cboDocumentImportanceId);
                args.ParameterValues.Add("PForeignCorrespondent", cboForeignCorrespondentId);
                args.ParameterValues.Add("PDocumentFrom", dateFrom);
                args.ParameterValues.Add("PDocumentTo", dateTo);
                args.ParameterValues.Add("Pshipment", Shipment);
            }
        }
code in report 
if (this.ReportParameters["PDocumentType"].Value.ToString() !="0")// error in step it sayed Object reference not set to an instance of an object.
            {
                if (x == 0)
                {
                    sqlWhere += " where (Document.DocumentType=" + Convert.ToInt16(this.ReportParameters["PDocumentType"].Value) + ")";
                    x = 1;
                }
0
Jonathan
Top achievements
Rank 1
answered on 05 Feb 2013, 05:09 PM
cast the sender to a report instead of using " this.ReportParameters"  then use report.Parameters

var report=(sender as Telerik.Reporting.Processing.Report);
0
Khalid
Top achievements
Rank 1
answered on 05 Feb 2013, 08:58 PM
dear Jonathan     

I try report.Parameters no use report.ReportParameters
this good and very thanks
Tags
General Discussions
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Peter
Telerik team
Jonathan
Top achievements
Rank 1
Khalid
Top achievements
Rank 1
Share this question
or