Quite difficult: Crystal_Report.datasource = ArrayList

B

Big Charles

Hello,

On my aspx page (VS.NET-2003), I am using a Repeater control, which is
binded with an ArrayList:

Dim arrAfiliado As New ArrayList
' Initializing dr as DataReader
' Then looping dr
Do While dr.Read
iCod_Op = dr.Item("cod_op").ToString()
oAfiliado = New Afiliado(sCod_DNI, iCod_Op)
arrAfiliado.Add(oAfiliado)
Loop

' As you see, at the end I have an ArrayList of an object called
oAfiliado.
' Then I bind Repeater control with that ArrayList

Repeater1.DataSource = arrAfiliado
Repeater1.DataBind()

On the aspx page, I display properties like: oAfiliado.Afil_Name

<td width="10%"><b>Afil Name :</b></td>
<td width="60%"><%# Container.DataItem.Afil_Name%></td>
<td width="10%"><b>Tipo :</b></td>

' Now I need to print that ArrayList of oAfiliado object using Crystal
Reports.
' Name of Crystal Report: CR_Afiliado.rpt
' The fields of my Crystal Report are designed based on an XML Schema
..xsd like:

<xs:schema id="XML_Afil"
targetNamespace="http://tempuri.org/XML_Afil.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/XMLDetalleAfil.xsd"
xmlns:mstns="http://tempuri.org/XML_Afil.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Afil">
<xs:complexType>
<xs:sequence>
<xs:element name="Afil_Name" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

On code behind:

Dim oRpt As New CR_Afiliado
oRpt.SetDataSource(arrAfiliado)

However, even that Repeater1 displays record, my CrystalReport doesn't
show any record and no error.
Has anybody dealt with the same problem, binding a Crystal Report with
an ArrayList of objects instead of a DataTable or DataSet?

Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top