469,910 Members | 1,433 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,910 developers. It's quick & easy.

Does anyone know why CrystalReport doesn't ask for parameters?

Hello, I have CrystalReport with 2 input parameters StartDate &
EndDate. When I run this report in Preview in VS2005 environment,
everything is fine, I get a dialog windows asking to provide input
parameters. When I run it from the application - it doesn't ask for
parameters.

In the application I had to modify connection information to connect
to different sql servers in different environments (DEV, TEST, PROD).
And here I have 2 questions:

1) Why method myReport.SetDatabaseLogon("username", "password",
"server", "database") DOES NOT WORK? Never. Does not change server and
database. IT IS A BUG, RIGHT?

2) Because method above doesn't work, I had to write a bunch of code
to change connection information like this:

Public Sub RunReport()
Dim rpt As New TestReport
Dim cap As String = "Test Report"
Dim cinfo As ConnectionInfo = New ConnectionInfo
cinfo.ServerName = "SERVER1"
cinfo.DatabaseName = "DATABASE1"
cinfo.UserID = "USERNAME1"
cinfo.Password = "PASSWORD1"
SetDBLogonForReport(cinfo, rpt)
Dim viewer As New ReportViewerForm(rpt, cap)
Me.mdiParent.ActivateChildForm(viewer)
End Sub

Private Sub SetDBLogonForReport(ByVal cinfo As ConnectionInfo, ByVal
rpt As ReportDocument)
For Each tbl As CrystalDecisions.CrystalReports.Engine.Table In
rpt.Database.Tables
Dim loginfo As TableLogOnInfo = tbl.LogOnInfo
loginfo.ConnectionInfo = cinfo
tbl.ApplyLogOnInfo(loginfo)
Next
End Sub

What happens when I run the report from the application - connection
information is changed, but the report doesn't ask for input
parameters at all. No Input Parameters Dialog box appear.

I anyone had a similar problem and knows the resolution, please help.
Thanks.

Mar 27 '07 #1
0 1195

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by s-galit | last post: by
2 posts views Thread by Vlatko | last post: by
reply views Thread by David Dvali | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.