Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: "Load Report Failed" - Not Everytime Post Reply Post New Topic
Author Message
_charles
Newbie
Newbie


Joined: 20 Oct 2010
Online Status: Offline
Posts: 2
Quote _charles Replybullet Topic: "Load Report Failed" - Not Everytime
    Posted: 20 Oct 2010 at 10:34am
Hello,
 
I am using Visual Studio 2008 and SQL Server 2008
 
I have added a CR using the report wizard that connects to a simple stored procedure with 3 params. When I run the report I get a pop up indicating that the "Load report failed". I then cancel out of the "Enter Parameter Values" and on the 2nd try the report loads correctly (sometimes it taskes 2 or 3 times). I am guessing that I have something configured incorrectly but not sure what - here is the code used to call the report:
 
CrystalReportViewer1.ReportSource = New ActivitiesReport

Dim field1 As ParameterField = Me.CrystalReportViewer1.ParameterFieldInfo(0)

Dim field2 As ParameterField = Me.CrystalReportViewer1.ParameterFieldInfo(1)

Dim field3 As ParameterField = Me.CrystalReportViewer1.ParameterFieldInfo(2)

Dim val1 As New ParameterDiscreteValue()

Dim val2 As New ParameterDiscreteValue()

Dim val3 As New ParameterDiscreteValue()

Dim employee As String = GetSystemEmployeeName()

val1.Value = employee

val2.Value = calBeginDate.Value

val3.Value = calEndDate.Value

field1.CurrentValues.Add(val1)

field2.CurrentValues.Add(val2)

field3.CurrentValues.Add(val3)

 
Any help would be greatly appreciated - especially a link to a Best Practices tutorial involving programatically loading CR's with parameters!! I remember when I was in college 8 years ago CR Best Practice examples were readily available from both MS and Crystal Reports.


Edited by _charles - 20 Oct 2010 at 11:04am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 22 Oct 2010 at 5:50am
I use this site as a reference:  http://devlibrary.businessobjects.com/BusinessObjectsXIR2/en/devsuite.htm.  However, this is an old BusinessObjects site and there's no telling how long SAP will keep it active.  Click on Crystal Reports .NET SDK, Tutorials and Sample Code, CrystalReportViewer Object Model, Reading and Setting Discrete Parameters, and Setting Parameters Manually in Code for a good example of the correct way to do this - it looks like your missing some steps in your code.
 
-Dell
IP IP Logged
_charles
Newbie
Newbie


Joined: 20 Oct 2010
Online Status: Offline
Posts: 2
Quote _charles Replybullet Posted: 22 Oct 2010 at 5:58am
hilfy,
 
Thank you for taking the time to answer! I set aside some time to work through the Visual Studio 2008/CR Tutorials at http://msdn.microsoft.com/en-us/library/ms227881(v=VS.90).aspx even though none of them were specifically for SQL Server AND parameters I was able to figure it out using the ReportDocument Object Model and non-embedded reports and a completely differnt way of passing in parameters.
 
I believe you are correct in that I was missing some steps - Smile.
 
Thanks again.
 
Charles
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.