how to pass parameter in crystal report from vb 6.0

how to pass parameter in crystal report from vb 6.0

Page 1 of 1

5 Replies - 26770 Views - Last Post: 01 December 2008 - 11:49 PM Rate Topic: -----

#1 hellovishal101  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 4
  • Joined: 28-October 08

how to pass parameter in crystal report from vb 6.0

Post icon  Posted 28 October 2008 - 11:22 PM

dear all
i m working with vb 6.0 and crystal report
i want to send parameter to the crystal report .
how can i do it.
Pls help me its urgent.
Is This A Good Question/Topic? 1

Replies To: how to pass parameter in crystal report from vb 6.0

#2 hellovishal101  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 4
  • Joined: 28-October 08

Re: how to pass parameter in crystal report from vb 6.0

Posted 29 October 2008 - 12:07 AM

ANY BODY PLEASE SEND ME THE CODE TO SEND PARAMETER TO CRYSTAL REPORT FROM VB 6.0 ...
Was This Post Helpful? 1

#3 eyesice  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 23-October 08

Re: how to pass parameter in crystal report from vb 6.0

Posted 29 October 2008 - 06:10 AM

Show us how you are calling your report
Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: how to pass parameter in crystal report from vb 6.0

Posted 29 October 2008 - 06:15 AM

View Posthellovishal101, on 29 Oct, 2008 - 12:07 AM, said:

ANY BODY PLEASE SEND ME THE CODE TO SEND PARAMETER TO CRYSTAL REPORT FROM VB 6.0 ...


[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#5 hellovishal101  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 4
  • Joined: 28-October 08

Re: how to pass parameter in crystal report from vb 6.0

Posted 29 October 2008 - 06:47 AM

View Posteyesice, on 29 Oct, 2008 - 06:10 AM, said:

Show us how you are calling your report



Path1 = "D:\vishal\Vishal\Vishal\rptIndAdmitCard.rpt"
Set rpt = app.OpenReport(Path1)
frm_viewer.CRViewer1.ReportSource = rpt
frm_viewer.CRViewer1.ViewReport
frm_viewer.Show
Was This Post Helpful? 0
  • +
  • -

#6 eyesice  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 23-October 08

Re: how to pass parameter in crystal report from vb 6.0

Posted 01 December 2008 - 11:49 PM

View Posthellovishal101, on 29 Oct, 2008 - 06:17 PM, said:

View Posteyesice, on 29 Oct, 2008 - 06:10 AM, said:

Show us how you are calling your report



Path1 = "D:\vishal\Vishal\Vishal\rptIndAdmitCard.rpt"
Set rpt = app.OpenReport(Path1)
frm_viewer.CRViewer1.ReportSource = rpt
frm_viewer.CRViewer1.ViewReport
frm_viewer.Show


you have two options

Option 1
rpt.ParameterFields(0) = "@parameter_name_1;" & "parameter_value" & ";TRUE"
rpt.ParameterFields(0) = "@parameter_name_2;" & "parameter_value" & ";TRUE"

or
Option 2
rpt.ParameterFields(1).AddCurrentValue ("parameter_value")
rpt.ParameterFields(2).AddCurrentValue ("parameter_value")


use Option 1 if you are not sure about the order of parameter variables in the collection. note that bound if Parameterfields() is kept at "0" In Option 2, we are not referring to the parameters by name assuming that they are always presented in the prescribed order.

here i'm using your "rpt" object

This post has been edited by eyesice: 01 December 2008 - 11:56 PM

Was This Post Helpful? 1

Page 1 of 1