Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing a parameter to a Crystal Report in ASP.Net
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00772781
Message ID:
00773044
Views:
14
Florencio,

The "logOnInfoNew" variable is Dimmed New but never used before you Dim New again. Do you have more than one logOnInfo? If not, then don't use the For Each and just set the LogOnInfo properties once.

>Hi Cathi,
>
>Thanks...again...for your reply. I have checked the link that you suggested and totaly revised my previous code, but I got a new error that tells that:
>
>Logon failed.
>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
>
>By the way, heres my new revised code:
>
> Dim params As New CrystalDecisions.Shared.ParameterFields()
> Dim param As New CrystalDecisions.Shared.ParameterField()
> Dim discreteVal As New CrystalDecisions.Shared.ParameterDiscreteValue()
>
> Dim inParameter As Integer
> Dim vrParameters(1)
>
> vrParameters(0) = "1/1/2003 0:0:0"
> vrParameters(1) = "2/15/2003 0:0:0"
>
> param.ParameterFieldName = "@dtFrm"
> discreteVal.Value = vrParameters(0)
> param.CurrentValues.Add(discreteVal)
>
> params.Add(param)
>
> param = New CrystalDecisions.Shared.ParameterField()
>
> param.ParameterFieldName = "@dtto"
> discreteVal.Value = vrParameters(1)
> param.CurrentValues.Add(discreteVal)
>
> params.Add(param)
>
> Dim logOnInfos As New CrystalDecisions.Shared.TableLogOnInfos()
> Dim logOnInfo As New CrystalDecisions.Shared.TableLogOnInfo()
> Dim logOnInfoNew As New CrystalDecisions.Shared.TableLogOnInfo()
>
> For Each logOnInfo In CRView.LogOnInfo
> logOnInfoNew = New CrystalDecisions.Shared.TableLogOnInfo()
> logOnInfoNew.TableName = logOnInfo.TableName
> logOnInfoNew.ConnectionInfo.ServerName = "bmman2k047"
> logOnInfoNew.ConnectionInfo.DatabaseName = "LINXGATEWAY"
> logOnInfoNew.ConnectionInfo.UserID = "devuser"
> logOnInfoNew.ConnectionInfo.Password = "user1"
> logOnInfos.Add(logOnInfoNew)
> Next
> CRView.LogOnInfo = logOnInfos
>
>
> CRView.ParameterFieldInfo = params
> CRView.ReportSource = "c:\InetPub\wwwRoot\CrystalDotNet\Reports\LinxAuditReport.rpt"
>
>Best Regards,
>Florencio
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform