Solved

Deploy ASP.NET application using crystal reports VS2005

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
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…

708 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