screenhot1111
screenhot1111

Reputation: 59

Crystal Reports is showing just one record

I'm a noob in Crystal Reports. I have a DataTable getting information from a DataGridView, here's the code:

 Dim dt As New DataTable
        With dt
            .Columns.Add("ID")
            .Columns.Add("Nombre")
            .Columns.Add("Cantidad")
            .Columns.Add("Descripcion")
            .Columns.Add("Fecha")
            .Columns.Add("Modulo")

        End With
        Dim rptDoc As CrystalDecisions.CrystalReports.Engine.ReportDocument
        rptDoc = New mello
        For Each dr As DataGridViewRow In dgvDatos.Rows
            dt.Rows.Add(dr.Cells(0).Value, dr.Cells(1).Value, dr.Cells(2).Value, dr.Cells(3).Value, dr.Cells(4).Value, dr.Cells(5).Value)
            rptDoc.SetDataSource(dt)
            Crystalino.CrystalReportViewer1.ReportSource = rptDoc
        Next
        '
        Crystalino.ShowDialog()
        Crystalino.Dispose()

But when I Run the program, it shows just one record:

enter image description here

So, I'd apreciate if you guys could help me

Upvotes: 0

Views: 1273

Answers (1)

Furtiro
Furtiro

Reputation: 449

Did you put your row data in the details Section in the report designer ?

If you put your data in an other section it will only display the first result and not fetch all the data. You 'll need to put your data in the details section to make crystalreport fetch your data ( row's data in your case )

Upvotes: 2

Related Questions