Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing a parameter to a Crystal Report in ASP.Net
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00772781
Message ID:
00773044
Vues:
13
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform