Solved

Deploy ASP.NET application using crystal reports VS2005

Posted on 2008-10-29
4
3,997 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
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…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now