on 09-06-2014 1:33 AM
I have a report I created in VS 2013. It connect to SQL Server 2008 R2. I'm using Crystal Version 13.0.2000.0
When I send the report to print it works fine. When I try to use a CrystaReportViewer1 it runs and I see the first page, the group tree show the other pages of the report. If I try to go to the next page, or any page for that matter, I get the login screen. The code I use, c#, to set the viewer is,
Report mp = new Report()
mp.SetDataSource((DataTable)prosData);
CrystalReportViewer1.ReportSource= mp;
At which time the report runs and I see the first page. The login page show the server as a dataset, and want allow me to enter a database name but wants a user name and a password. Nothing I enter works.
The behavior makes me assume that this is a web app. Place teh report into a session and that should resolve the issue. See:
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a web app. I implementing the example. The line,
crReportDocument = (ReportDocument)Session["Report"];
Give me the error, Cannot implicitly convert type 'CrystalDecisions.CrystalReports.Engine.ReportDocument' to'ProjectName.ReportDocument'. An explicit conversion exists (are you missing a cast?) also the line, crReportDocument.SetParameterValue("LocationId", fwsuser.currentLocation); Does fwsuser mean the current user id the app is running under?
Hi David
There is a number of KBAs on how to place a report object in session. Use the search term 'crystal net session' in the search box at the top right corner. You may also want to see Crystal Reports for Visual Studio 2005 Walkthroughs, "Persisting the ReportDocument Object Model Using Session", page 101. The doc applies to all versions of .NET and CR.
The Developer Help files are also pretty good:
SAP Crystal Reports .NET SDK Developer Guide
SAP Crystal Reports .NET API Guide
- Ludek
I am one step closer, the report is now working on the developer machine. However when the page run on the web server it doesn't work. It shows the asp header on the page but the CrystalReportView does not display. It's like the viewer is not even on the page. No error or anything. Before I fixed the login problem it was displaying the login error. How can I troubleshoot this nothingness? Do you know what the problem is? The database and the login are identical on the web server. The only thing that is different is the server name which I change for the server version.
Theoretically as this is a new question, it should be in a new post (SCN Rules of Engagement and all that). Next time...
Anyhow, the reason the viewer is not appearing is more than likely because it is not configured correctly. Again, searching for 'crystal net viewer' should bring up a number of resources. I like this 3rd party blog also:
- Ludek
The link you shared fixed my problem on the server! However it took a while to figure out where to put the additions to the web.config file. The section goes in the section of the web.config file, and it must be the FIRST section in the section. The section goes in the section, and it looks like it can go anywhere, but it can't be first since the must be first. In my case I put it last. Hope this helps someone out. I got a gizilion errors till I had them placed properly.
The link you shared fixed my problem on the server! However it took a while to figure out where to put the additions to the web.config file.
The "ConfigSections" section goes in thesection of the web.config file, and it must be the FIRST section in the "configuration" section.
The "businessObjects" section goes in thesection, and it looks like it can go anywhere, but it can't be first since the "ConfigSections" must be first. In my case I put it last.
Hope this helps someone out. I got a gizilion errors till I had them placed properly.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.