none
RDLC Conversion from C# 2005 to C# 2010 RRS feed

  • Question

  • Hi there

    I'm creating a WinApp program in C#. I have used VS2005 Pro, but have recently upgraded to VS2010 Pro. Everything seems to be working fine, except for the reporting side.

    When I attempt to run a report, I receive the following error message, prior to getting a blank page in my report: "An error occurred during local report processing".

    I have traced the problem to my SetParameter statement, which looks like this:

            this.rvExposuresDMT.LocalReport.SetParameters(new ReportParameter[]
              {
                new ReportParameter("parImpExp", this.Imp_Exp, true),
                new ReportParameter("parS_Year", this.S_Year, true),
                new ReportParameter("parS_Month", this.S_Month, true),
                new ReportParameter("parE_Year", this.E_Year, true),
                new ReportParameter("parE_Month", this.E_Month, true)
              });
    
    

     

    This used to work 100% in VS2005. What should I change? What am I missing?

    You assistance will be appreciated.

    Thanx
    Hennie


    It's not the blowing of the wind that determines your destination, it's the set of the sail. J Rohn
    Tuesday, February 8, 2011 7:44 AM

Answers

  • Resolved.

    For anyone else who may sit with the same problem, if you're using C#, please follow the steps below:

    1. Open your C# 2005 project in VS 2010, allow the conversion to take place.
    2. In Solution Explorer, select the Project where your reports are located.
    3. From the MenuStrip select Project, then your project Properties.
    4. Select the Application tab and change the Target framework to .Net Framework 4.
    5. In Solution Explorer, select your Project then expand References.
    6. Delete Microsoft.ReportViewer.Common as well as Microsoft.ReportViewer.WinForms.
    7. Add both References back, ensure that you select version 10.0.0.0.
    8. Open all rdlc-files, and click OK to perform their conversion.

    Following these steps sorted out my problem. I hope it can be of assistance to someone else.

    Hennie


    It's not the blowing of the wind that determines your destination, it's the set of the sail. J Rohn
    • Marked as answer by HennieSmit Friday, February 25, 2011 8:50 AM
    Friday, February 25, 2011 8:50 AM

All replies

  • You can insert the LocalReport.GetReportParameters method during debugging to get information on the report parameters in the report and make sure that the report parameter names are exactly the same as the names expected by the ReportViewer control.

    If all you did was upgrade your project, you're still using the ReportViewer control from VS2005. You can check your Web.config to see whether the references have 10.0.0.0 as the version number. This is not a problem, but just to point it out so there's no confusion.


    Cephas Lin This posting is provided "AS IS" with no warranties.
    Tuesday, February 8, 2011 4:15 PM
    Moderator
  • Thanx cephalin

    As stated, I'm create a WinApp. Therefor have no Web.config file. But I will have a look around in the project properties. Thanx.


    It's not the blowing of the wind that determines your destination, it's the set of the sail. J Rohn
    Wednesday, February 9, 2011 6:47 AM
  • No joy. Do you have any other suggestions?

    I have tried ReportParamater() without the 3rd parameterm as well as either option the 3rd parameter. Still get the same result.

    Thanx


    It's not the blowing of the wind that determines your destination, it's the set of the sail. J Rohn
    Wednesday, February 9, 2011 1:29 PM
  • Are there any other suggestions as to what I can/should? It has become a desperate situation.

    I have the following using-statements, should I include anything else due to VS 2010?

     using System;
     using System.Collections.Generic;
     using System.ComponentModel;
     using System.Data;
     using System.Data.Common;
     using System.Data.SqlClient;
     using System.Drawing;
     using System.Text;
     using System.Windows.Forms;
     using Microsoft.Reporting.WinForms;

    Does anyone have any other suggestions?

    Thanx
    Hennie


    It's not the blowing of the wind that determines your destination, it's the set of the sail. J Rohn
    Friday, February 11, 2011 7:02 AM
  • Any suggestions?

    Thanx
    Hennie


    It's not the blowing of the wind that determines your destination, it's the set of the sail. J Rohn
    Tuesday, February 15, 2011 6:02 AM
  • Resolved.

    For anyone else who may sit with the same problem, if you're using C#, please follow the steps below:

    1. Open your C# 2005 project in VS 2010, allow the conversion to take place.
    2. In Solution Explorer, select the Project where your reports are located.
    3. From the MenuStrip select Project, then your project Properties.
    4. Select the Application tab and change the Target framework to .Net Framework 4.
    5. In Solution Explorer, select your Project then expand References.
    6. Delete Microsoft.ReportViewer.Common as well as Microsoft.ReportViewer.WinForms.
    7. Add both References back, ensure that you select version 10.0.0.0.
    8. Open all rdlc-files, and click OK to perform their conversion.

    Following these steps sorted out my problem. I hope it can be of assistance to someone else.

    Hennie


    It's not the blowing of the wind that determines your destination, it's the set of the sail. J Rohn
    • Marked as answer by HennieSmit Friday, February 25, 2011 8:50 AM
    Friday, February 25, 2011 8:50 AM