In VS2005 I have a pair of files for each report:
- ReportName.rpt
- ReportName.xsd
In VS2008, when you bring an XSD file into a project it creates 3 other files:
- ReportName.Designer.cs
- ReportName.xsc
- ReportName.xss
In point of fact, all the conflicts occured within the ".Designer.cs" files. There are global variables in each one that cause repeat definitions of the same variables, which is not allowed.
So I did a little research and came across this blog entry. I ended up following just the first part, which was to delete the ".Designer.cs" and ".xss" files. Plus, because all the ".xsc" files were empty, I deleted them too.
Lo and behold, I rebuilt the solution but these excess files were never recreated. More importantly, the reports worked perfectly once again!
Update: One problem I've discovered with the above procedure is that you still end up with one warning message per report like this:
The custom tool 'MSDataSetGenerator' failed while processing the file 'Reports\Templates\MTHOBRK3.xsd'.
The application still runs but I don't like any such warning messages to be present. After a little trial & error I found this to be the ultimate solution:
- Delete the .xsc & .xss files only.
- Replace the entire contents of each .Designer.cs file with the following:
namespace Website.Reports.Templates
{
public partial class NewDataSet
{
}
}
#pragma warning restore 1591
I am using visual studio 2008 to develop a web application where I am using the crystal reports. I have placed the viewer in my default.aspx page. I am using datasets which hit the sql server 2005 tables. Right now the application runs off of my local host, is not published to a server. I have following questions.
ReplyDelete1. Do I need to have crystal reports installed in the clients' machine also for them to view the report or it opens as an html page?
2. Right now, I can query and view my results in the crystal report viewer. It just works fine. I am trying to use the default crystal report viewer toolbar to export, print and navigate to different pages of report. So I can view the report, it just works so fine until I press one of the default buttons in the toolbar. For eg, on the report, when I get the results, if I click on Export button of the toolbar, it pops up the window for export but then the aspx page where I have the viewer immediately comes out with error.."Database logon failed.Cordus_Opolus. ..C:\local settings\ user\temp\.....reportname.rpt. Cannot set the object reference to its instance...unable to log in." Why does this happen? When I can view the report fine, that means I am able to login successfully and display the result in the viewer but why does it error out when I try to export or print or go to next page or previous page? Could you please share your ideas\experiences on this issue?
You only need to have the necessary CR DLLs installed on the server, not on the client machines. Also, my understanding is that if the users don't need to design any reports on their own then the license that comes with VS2008 is sufficient to deploy the CR reports at no extra cost.
ReplyDeleteI've never used the CR Viewer so have no advice for you, sorry.