For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > January 2006 > Outputing Parameters









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Outputing Parameters
SABmore

2006-01-31, 7:09 pm

I'm working thru the Crystal.Net tutorials and have hit a small snag. I can
only get the first value added to my output to be displayed even though the
code parses thru and appears to add the additional values. Within the report
my parameter (Traveler) is set to "have multiple values" and "discrete
values."

Anny and all help is greatly appreciated.

My pseudo code is as follows:

Private memoReport As Memo 'report name
Private Const PARAMETER_FIELD_NAME AS String = "Traveler"

Private Sub Page_Init()
ConfigureCrystalReports()
End Sub

Private Sub ConfigureCrystaReports()
memoReport = New Memo

Dim travelers as IList = 'list of travelers (I'm using NHibernate, so I'll
spare you the code, but it does return a list of travelers and their
properties)

SetCurrentValuesForParameterField(memoRe
port, travelers)
CrystalReportView1.ReportSource = memoReport
End Sub

Private Sub SetCurrentValuesForParameterField(ByVal myReport As
ReportDocument, ByVal myIList As IList)
Dim currentParameterValues As ParameterValues = New ParameterValues
Dim foundTraveler As Traveler
For each foundTraveler in myIList
Dim myParameterDiscreteValue As ParameterDiscreteValue = New
ParameterDiscreteValue
myParameterDiscreteValue.Value = foundTraveler.FirstName.ToString 'gets value
currentParameterValues.Add(myParameterDiscreteValue) 'adds value
Next
Dim myParameterFieldDefinitions As ParameterFieldDefinitions =
myReportDocument.DataDefinition.ParameterFields
Dim myParameterFieldDefinition As ParameterFieldDefinition =
myParameterFieldDefinitions(PARAMETER_FI
ELD_NAME)
myParameterFieldDefinition. ApplyCurrentValues(currentParameterValue
s)
End Sub
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com