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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing an array to parameter field

Status
Not open for further replies.
Sep 29, 2003
28
0
0
BY
I've created some reports. They're launched from Lotus Notes database. Is it possible to pass an array of values from Lotus Script to one parameter field in report (and what type of parameter field it should be)? I've tried this script, but it doesn't work:

Sub Postopen(Source As Notesuidocument)
Dim Viewer As Variant
Set Viewer = Source.getObject( "Crystal Report Viewer Control 9" )
Dim App As Variant
Set App = createObject( "CrystalRuntime.Application" )
Dim Rep As Variant
Set Rep = App.openReport( "C:\Temp\report.rpt" )
Rep.Database.tables().setLogOnInfo server, db, user, pw
Dim paramar(1 To n) As String
paramar(1) = "string1"
paramar(2) = "string2"
paramar(3) = "string3"
...
paramar(n) = "stringN"
Rep.ParameterFields(3).AddCurrentValue paramar
Set Viewer.reportSource = Rep
Viewer.viewReport
Exit Sub
End Sub
 
CrazyManiac,

I might be missing something here, but I would think that you need a parameter that has been defined to accept multiple values. You then loop though your array; for each time round the loop, call the parameter field's AddCurrentValue() method, passing the contents of the current element of the array.

Mike


Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top