-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: KaustavN
Message 3 in Discussion
Hi <st1:place w:st="on">Ravi</st1:place>,<o:p></o:p>
<o:p> </o:p>
You can pass report parameters in the
following manner �<o:p></o:p>
<o:p> </o:p>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click<o:p></o:p>
Dim oRpt As New ReportDocument()<o:p></o:p>
Dim paramfields As New ParameterFields()<o:p></o:p>
Dim param1 As New ParameterField()<o:p></o:p>
Dim dc As New ParameterDiscreteValue()<o:p></o:p>
param1.ParameterFieldName = "firstname"<o:p></o:p>
dc.Value = TextBox1.Text<o:p></o:p>
param1.CurrentValues.Add(dc)<o:p></o:p>
paramfields.Add(param1)<o:p></o:p>
oRpt.Load("D:\vs projects\crparam\crparam.rpt")<o:p></o:p>
CRV1.ParameterFieldInfo = paramfields<o:p></o:p>
CRV1.ReportSource = oRpt<o:p></o:p>
<o:p> </o:p>
End Sub<o:p></o:p>
<o:p> </o:p>
HTH.<o:p></o:p>
<o:p> </o:p>
Kaustav Neogy.<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
From: Ravikumarcbe
[mailto:[EMAIL PROTECTED]
Sent: Monday, <st1:date Year="2004"
Day="15" Month="3" ls="trans" w:st="on">March 15, 2004</st1:date> <st1:time
Minute="41" Hour="11" w:st="on">11:41 AM</st1:time>
To: <st1:PersonName w:st="on">BDOTNET</st1:PersonName>
Subject: Crystal Report Parameter
value!!!<o:p></o:p>
<o:p> </o:p>
<o:p></o:p>
<o:p></o:p>
New
Message on BDOTNET<o:p></o:p>
<o:p></o:p>
<o:p> </o:p>
Crystal Report
Parameter value!!!<o:p></o:p>
Reply
<o:p></o:p>
<o:p></o:p>
Reply to Sender Recommend
<o:p></o:p>
Message 1 in
Discussion <o:p></o:p>
<o:p></o:p>
From: Ravikumarcbe <o:p></o:p>
<o:p> </o:p>
Hi ,<o:p></o:p>
I have written the code for
passing the parameter ,<o:p></o:p>
Dim pcol As New
CrystalDecisions.Shared.ParameterValues()<o:p></o:p>
Dim pval As New
CrystalDecisions.Shared.ParameterDiscreteValue()<o:p></o:p>
Dim tl As
Table<o:p></o:p>
Dim loginfo As
TableLogOnInfo<o:p></o:p>
Dim rp As New ReportDocument()<o:p></o:p>
Me.Cursor = Cursors.WaitCursor<o:p></o:p>
rp.Load(Application.StartupPath
& "\crp.rpt")<o:p></o:p>
For Each tl In rp.Database.Tables<o:p></o:p>
loginfo
= tl.LogOnInfo<o:p></o:p>
With loginfo.ConnectionInfo<o:p></o:p>
ServerName
= ServerNAme<o:p></o:p>
UserID
= UserID<o:p></o:p>
Password
= Pwd<o:p></o:p>
DatabaseName
= Database<o:p></o:p>
End With<o:p></o:p>
tl.ApplyLogOnInfo(loginfo)<o:p></o:p>
Next tl<o:p></o:p>
pval.Value
= 2<o:p></o:p>
pcol.Add(pval)<o:p></o:p>
rp.DataDefinition.ParameterFields("@Code").ApplyCurrentValues(pcol)<o:p></o:p>
pcol.Clear()<o:p></o:p>
pval.Value
= "01/" & CType(DTMonth.Value,
Date).Month &
"/" & CType(DTMonth.Value,
Date).Year<o:p></o:p>
rp.DataDefinition.ParameterFields("@FromDate").ApplyCurrentValues(pcol)<o:p></o:p>
pval.Value
= DTMonth.Value.DaysInMonth(DTMonth.Value.Year, DTMonth.Value.Month)
& "/" & CType(DTMonth.Value,
Date).Month &
"/" & CType(DTMonth.Value,
Date).Year<o:p></o:p>
rp.DataDefinition.ParameterFields("@ToDate").ApplyCurrentValues(pcol)<o:p></o:p>
pcol.Clear()<o:p></o:p>
pval.Value
= CboEmployee.SelectedValue<o:p></o:p>
pcol.Add(pval)<o:p></o:p>
rp.DataDefinition.ParameterFields("@EmpCode").ApplyCurrentValues(pcol)<o:p></o:p>
pcol.Clear()<o:p></o:p>
pval.Value
= CboEmployee.SelectedValue<o:p></o:p>
pcol.Add(pval)<o:p></o:p>
rp.DataDefinition.ParameterFields("@EmpCode").ApplyCurrentValues(pcol)<o:p></o:p>
pcol.Clear()<o:p></o:p>
CV.ReportSource
= rp<o:p></o:p>
<o:p> </o:p>
<o:p></o:p>
My
problem is , it doesn't take this parameter values what I have specified
thru code, it keep asking the parameter values thru dialog box,<o:p></o:p>
what
could be the problem , anything missing in my code<o:p></o:p>
<o:p></o:p>
Thanx
in advance<o:p></o:p>
<o:p></o:p>
Rgds,<o:p></o:p>
<st1:place w:st="on">Ravi</st1:place><o:p></o:p>
<o:p></o:p>
<o:p></o:p>
View other groups in this
category.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]