locked
Problems with Crystal Reports when Upgrading from VS2008 to VS2012 RRS feed

  • Question

  • User-1334042570 posted

    Long ago I created many Crystal Reports templates in a Visual Studio 2008 Web App project.  I'm now upgrading to Visual Studio 2012.  I'm fully aware that SAP / Business Objects is not yet ready with their Crystal Reports addin for VS2012 but I've also read that there should be no problem using existing report templates from VS2008 or VS2010.

    After I initially loaded my project into VS2012, I corrected the missing References:

    1. CystalDecisions.CrystalReports.Engine
    2. CrystalDecisions.ReportSource
    3. CrystalDecisions.Shared

    Then I rebuilt my project.  Unfortunately I'm getting hundreds of errors that all reference the various "######.Designer.cs" files in my project.  These error have wordings like this:

    • Error    1    The type 'Website.Reports.Templates.NewDataSet' already contains a definition for '_schemaSerializationMode'    C:\Projects\Clients\ValeThom\Incentives\Website\Reports\Templates\WBMDRILL3.Designer.cs
    • Error    22    Type 'Website.Reports.Templates.NewDataSet' already defines a member called 'NewDataSet' with the same parameter types    C:\Projects\Clients\ValeThom\Incentives\Website\Reports\Templates\WBMDRILL3.Designer.cs
    • Error    64    The type 'Website.Reports.Templates.NewDataSet' already contains a definition for 'SchemaSerializationMode'    C:\Projects\Clients\ValeThom\Incentives\Website\Reports\Templates\WBMDRILL3.Designer.cs

    I'm completely new to VS2012 and ASP.NET 4.0 so I'm not yet familiar with the new features in this environment but I'm sensing that these messages have something to do with different scoping rules.

    I'm hoping that all of these errors should be easy to fix because each of my "#######.Designer.cs" files has identical content:

    #pragma warning disable 1591
    
    namespace Website.Reports.Templates
    {
      public partial class NewDataSet
      {
      }
    }
    
    #pragma warning restore 1591


    I don't actually remember where/when I learned to place this content into the Designer.cs files but it was done to resolve a problem with Crystal Reports back in VS2008.  It's clearly not working now though!

    I'm hoping that someone else has experienced something similar and could provide me some guidance about what to do to resolve these error messages.

    Sincerely,

    Robert Werner

    Vancouver, BC


    Thursday, December 27, 2012 7:06 PM

All replies

  • User-1334042570 posted

    My question now turns into a solution!  I was incorrect about something I wrote originally.  In point of the fact, what happened when I initially loaded my VS2008 project in VS2012 is that the "#######.Designer.cs" files had their contents changed from what was originally there into much lengthier (and clearly conflict-ridden) C# code.

    So, I consulted a document I had long ago made about Constructing a New Crystal Reports template.  At the end of it were some important notes I had long since forgotten.  But when I followed them again, all of those hundreds of errors disappeared, my project compiled properly in VS2012, and I able to generate reports once again!

    Here are the key notes:

    When adding XSD files into a Visual Studio project, three companion files may be automatically generated:

    1. *.xsc
    2. *.xss
    3. *.Designer.cs

    The first two are not required and can be deleted.  Code in the last one may conflict with code in the report templates own ".cs" file.  After rebuilding the Solution, if warning messages appear related to these reports then just do this:

    1. Close Visual Studio
    2. Open each offending ".Designer.cs" file in a text editor and replace the entire contents with this:

                        #pragma warning disable 1591

                        namespace Website.Reports.Templates

                        {

                           public partial class NewDataSet

                           {

                           }

                        }

                       #pragma warning restore 1591

    1. Save each file.
    2. Open the project again and rebuild.

    -- End of Notes --

    Thursday, December 27, 2012 7:45 PM