Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report on the Web

Status
Not open for further replies.

ShauNotDeaD

Programmer
Joined
Oct 13, 2006
Messages
3
Location
US
Hello all,

I'm not too familiar with the web controls as I am used to console apps. I'm trying to get a crystal report to print be viewable and printable on the web. I added the Crystal report to the project, then put a crystal report source control on the page and set its report source to my report (via the dropdown list on the web view). I then drop a crystal report viewer control and set its report source to the report source control previously placed. Now I need to pass my report two values dynamically. The code I've been fooling with looks something like this:



Dim myTableLogonInfos As TableLogOnInfos = New CrystalDecisions.Shared.TableLogOnInfos()
Dim myTableLogonInfo As TableLogOnInfo = New CrystalDecisions.Shared.TableLogOnInfo()
Dim myConnectionInfo As ConnectionInfo = New CrystalDecisions.Shared.ConnectionInfo()

With myConnectionInfo
.ServerName = "SQLTest2"
.DatabaseName = "AccountsReceivable2"
.UserID = "sa"
.Password = "pass"
End With

myTableLogonInfo.ConnectionInfo = myConnectionInfo

myTableLogonInfo.TableName = "rpt_Schedules"

myTableLogonInfos.Add(myTableLogonInfo)
viewerRptSchedules.LogOnInfo = myTableLogonInfos 'the crystal report viewer

Dim myParamField1 As New CrystalDecisions.Web.Parameter
Dim myParamField2 As New CrystalDecisions.Web.Parameter
Dim myParams As New CrystalDecisions.Web.ParameterCollection

myParamField1.DefaultValue = "1"
myParamField1.Name = "strCompanyName"
myParamField2.DefaultValue = "015210"
myParamField2.Name = "strEmployee"
myParams.Add(myParamField1)
myParams.Add(myParamField2)



I tried for the longest time using crystaldecisions.shared.parameterfield(s) and similar, but it wasnt working. Figured I'd give the .web.parameter thing a shot. However, I couldnt find any logonInfo classes objects under .web. What to do? Oh, by the way, my error is always either "Could not log on, etc." or "Invalid parameter values", depending on what I fool with.



Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top