Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable parameter window in CR8.5

Status
Not open for further replies.

sane79

MIS
Nov 18, 2003
60
SG
Howdy experts..!

I need some help here.
I have created a program in VB6, which is supposed to pass some parameters (String and Date) into CR8.5

I have got the report out.. but my problem here is.. How do I get CR8.5 to accept the parameters from my VB program instead of popping up the parameters windows to accept user's input?
Can anyone pls advise?
Thanks in advance!
 
You need to set the report's EnableParameterPrompting property to false.

I don't have my code in front of me at present, but the following should get you started (assuming you've got a reference to craxdrt.dll, and are using the CRViewer control). You should also try a keyword search in the forums if you need more code.

Code:
    Dim crxApp As CRAXDRT.Application
    Dim crxRpt As CRAXDRT.Report

    Set crxApp = New CRAXDRT.Application
    Set crxRpt = app.OpenReport(App.Path & "\report.rpt")
    crxRpt.Database.Tables(1).SetLogOnInfo "servername", "dbname", "userid", "password"
    crxRpt.ParameterFields(1).AddCurrentValue "ParamValue"
Code:
crxRpt.EnableParameterPrompting = False
Code:
    CRViewer1.ReportSource = crxRpt
..............

-dave
 
THANKS Dave!

Got it working... I have antoehr problem here..

Over in crystal report, I'm not able to display the fields that are related to the 2 paramters that are passed over..

What happens is I need to select from the dbf tables, all the records that are related to the 2 parameters..

Can u advise me on how I should do it other than using stored procedure?


Below is my workable parameter passing code:
============================================

Set creApp = New CRPEAuto.Application
Set CreRpt = creApp.OpenReport(App.Path & "\PICKLISTREPORT.rpt")
Set rptDB = CreRpt.Database
Set rptTbls = rptDB.Tables
Set rptTbl = rptTbls.Item(1)

Set creParaFldDefs = CreRpt.ParameterFields
Set crePara = creParaFldDefs.Item(1)
crePara.SetCurrentValue (tmpbcode)

Set crePara = creParaFldDefs.Item(2)
crePara.SetCurrentValue (tmpPOID)

rptTbl.SetPrivateData 3, rs

'CreRpt.Preview

============================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top