Link to home
Start Free TrialLog in
Avatar of gmelton
gmelton

asked on

Deploy ASP.NET application using crystal reports VS2005

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

Avatar of anipeddi
anipeddi

Avatar of gmelton

ASKER

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!
ASKER CERTIFIED SOLUTION
Avatar of gmelton
gmelton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.