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:
CystalDecisions.CrystalReports.Engine
CrystalDecisions.ReportSource
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.
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:
*.xsc
*.xss
*.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:
Close Visual Studio
Open each offending ".Designer.cs" file in a text editor and replace the entire contents with this:
rmdw
Participant
825 Points
1228 Posts
Problems with Crystal Reports when Upgrading from VS2008 to VS2012
Dec 27, 2012 11:06 PM|LINK
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:
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:
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 1591I 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
Vancouver, BC
Technical Blog
Pocket Pollster
rmdw
Participant
825 Points
1228 Posts
Re: Problems with Crystal Reports when Upgrading from VS2008 to VS2012
Dec 27, 2012 11:45 PM|LINK
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:
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:
#pragma warning disable 1591
namespace Website.Reports.Templates
{
public partial class NewDataSet
{
}
}
#pragma warning restore 1591
-- End of Notes --
Vancouver, BC
Technical Blog
Pocket Pollster