Hi to all:
I have this code in VB that extract from listview values to CR parameter fields...I have in one listview.items 3 records that have the same value and CR returns a error when,in the cicle For Next, pass for the same value...The error is:"The value you want include is already exists"...
Can anyone tell me what is the problem?We could not have records with the same values?Wich way I can resolve this?
Code:Dim Report As New CRAXDRT.Application Dim Rpt As CRAXDRT.Report Dim formula As CRAXDRT.FormulaFieldDefinition Set Report = New CRAXDRT.Application Set Rpt = Report.OpenReport(App.Path & "\Relatório_Aves_1selecao.rpt") If (Rpt.HasSavedData) Then Rpt.DiscardSavedData Rpt.EnableParameterPrompting = False For s = 1 To ListView1(1).ListItems.Count Rpt.ParameterFields(1).AddCurrentValue (ListView1(1).ListItems.Item(s)) Rpt.ParameterFields(2).AddCurrentValue (ListView1(1).ListItems.Item(s).SubItems(1)) Rpt.ParameterFields(3).AddCurrentValue (ListView1(1).ListItems.Item(s).SubItems(2)) Rpt.ParameterFields(4).AddCurrentValue (ListView1(1).ListItems.Item(s).SubItems(3)) Rpt.ParameterFields(5).AddCurrentValue (ListView1(1).ListItems.Item(s).SubItems(4)) Rpt.ParameterFields(6).AddCurrentValue (ListView1(1).ListItems.Item(s).SubItems(5)) Next setviewersize CRViewer1.ReportSource = Rpt CRViewer1.ViewReport
Thanks




Reply With Quote