Solved

Deploy ASP.NET application using crystal reports VS2005

Posted on 2008-10-29
4
4,014 Views
Last Modified: 2009-07-07
I have an ASP.NET application using C# and Crystal Reports.

Setup:
     I have a stored procedure that requires parameters.  I use a SqlDataSource to populate the parameters and retrieve the data.  I know this part is working since I used a GridView to view the returned data.

     I created a similar stored procedure but removed the parameters by changing them to local variables and assigning hardcoded values.

     I then created an XML schema within VS2005 that references the modified stored procedure.

     Using this XSD file, I built my crystal report.

     On a web form I added a CrystalReportViewer.  
     I selected to create a new CrystalReportSource
     I selected the report I created in the previous step

     Next I selected the CrystalReportSource and examined the properties
     Under the "Report" item, I selected the DataSources element
     I clicked the ADD button then selected my SqlDataSource    
     I left "Main Report" Selected
     I checked the "Specify Table Name" box and entered the name of the stored procedure
     Clicked OK to save

When I run the application on my development machine, everything works correctly

Problems happen when I deploy to our server.
     When the report is run by default when the web form is loaded, The following error occurs:  

          Logon failed. Details: mscorlib : Could not find a part of the path 'C:\dev\projects\......\XMLSchema.xsd'. Error in File C:\DOCUME~1\username\LOCALS~1\Temp\ReportName {2A2D1F47-B1AD-4085-91CE-41297E61EBFB}.rpt: Unable to connect: incorrect log on parameters

     When parameters are entered into the controls and the "Submit" button is clicked,  Everything works correctly.

     Why is this error occurring?  I thought the XSD file was only used to build the report and not referenced a run time.

Thank you for your assistance

0
Comment
Question by:gmelton
  • 2
4 Comments
 
LVL 4

Expert Comment

by:anipeddi
ID: 22833049
0
 

Author Comment

by:gmelton
ID: 22834372
Thank you but those articles are not what I am looking for.  I can get the report to display corectly once I click the Submit Button in my application.  The problem occurs when the page first loads.  

On my development machine, the first time the page is loaded I get an empty report except for the TextObjects placed on the report.  At this time I make a selection from the databound DropDownList control that is used to specify a parameter. Once this is done I click the Submit button and the entire reports displays correctly.

On the test server, the first time I load the page I get the databound controls for parameter selection and only the Toolbar for the Crystal Report.  Not even the TextObjects are displayed.  Just above the Toolbar is the following error message:

Logon failed. Details: mscorlib : Could not find a part of the path 'C:\dev\projects\......\XMLSchema.xsd'. Error in File C:\DOCUME~1\username\LOCALS~1\Temp\ReportName {2A2D1F47-B1AD-4085-91CE-41297E61EBFB}.rpt: Unable to connect: incorrect log on parameters

At this time I make a selection from the databound DropDownList that is used to specify a parameter. Once this is done I click the Submit button and the entire reports displays correctly.

This leads me to believe that the issue is when the report/CrystalReportSource is bound to the SqlDataSource.  Could it be that the parameters are not defined by default when the binding occurs.  Maybe its a matter of programmatic setting of the parameters.

I still do not understand why it is trying to access the XSD schema during runtime.

Thanks again!
0
 

Accepted Solution

by:
gmelton earned 0 total points
ID: 22841762
I have found the solution to this problem.  When the page is loaded, I assigned the initial value for the paramaters used by the SqlDataSource.  This corrected the problems I was having.

Thanks again !
0
 

Expert Comment

by:Crystal2009
ID: 25935493
Hi gmelton,

You said that when the page is loaded, I assigned the initial value for the paramaters used by the SqlDataSource.

Can you tell me more details on how to assign the initial value for the parameters.

Thanks.

0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question