Quite difficult: Crystal_Report.datasource = ArrayList

Discussion in 'ASP .Net' started by Big Charles, Jan 16, 2007.

  1. Big Charles

    Big Charles Guest

    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!
     
    Big Charles, Jan 16, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Saravanan Rathinavelu

    Iterate through ArrayList using an another ArrayList

    Saravanan Rathinavelu, Aug 16, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    2,800
    Natty Gur
    Aug 19, 2003
  2. Kaidi
    Replies:
    4
    Views:
    2,502
    Kaidi
    Jan 3, 2004
  3. xz
    Replies:
    16
    Views:
    2,448
  4. Philipp
    Replies:
    6
    Views:
    979
    Arne Vajhøj
    May 28, 2008
  5. Martin Gregersen

    Sorting with datasource ArrayList

    Martin Gregersen, Nov 10, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    817
    mtadd
    Nov 10, 2006
Loading...

Share This Page