cancel
Showing results for 
Search instead for 
Did you mean: 

Rows repeating themselves, without incrementing row count

Former Member
0 Kudos

Well, here's my problem. As the title says, some of my data's repeating itself. I first thought it might come from loops, but it quickly became obvious that it wasn't the case. It's especially strange since my table count doesn't take in consideration the repeated lines.

Here's the part of my code that interests us :


While Not rs.EOF
    package = New Package(cnn, CLng(rs.Fields("No_Package").Value))
    nbModules = nbModules + package.get_nb_modules

    dataset.item.AdditemRow("PACKAGE NO." & package.get_id)
    dataset.item.AdditemRow("Has " & package.get_nb_modules & " modules")
    dataset.item.AdditemRow("Date : " & package.get_date_creation)
    dataset.item.AdditemRow("Actual nb of rows : " & dataset.item.count)

    rs.MoveNext()
End While

It should get me something like this :


PACKAGE NO.X
Has X modules
Date : [some date]
Actual nb of rows : 3

[and so on]

But here's what I get :


PACKAGE NO.X
PACKAGE NO.X
Has X modules
Has X modules
Date : [some date]
Date : [some date]
Actual nb of rows : 3   [<-- odd]

[and so on]

If it's a known bug or issue, I'd really like to know how to solve it. In any case, I haven't modified any parameters regarding my fields, report or printer.

Thanks.

Edited by: carle_al on Apr 27, 2009 11:45 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Information required:

- Visual Studio version.

- Crystal Report product used with patch level.

- Type of application (wind/web)

- How does the report behave in designer?

- Are you trying to assign the fields in the report on the fly?

Thanks,

AG.

Former Member
0 Kudos

Visual Studio 2005 (version 8.0).

Crystal Report v10 (with the label Business Object, used in the studio). Can't tell the patch level though.

Window application.

In designer and preview everything goes just fine, as with the header and footer fields. My only problem goes with the "body" (not sure it's the right name, I use a french version).

Not sure neither of what you mean by on the fly. Once the program starts, I fill my dataset and send my report to a report viewer for testing. I checked how it behave when printed directly and it ain't got any better.

Here's the part where I send it to the CRviewer :

cr.SetDataSource(dataset)
CRviewer.ReportSource = cr

Nothing fancy.

Thanks.

Former Member
0 Kudos

Hi,

try this code:

datasetObject.WriteXml("c:\\temp\\myData1.xml",XmlWriteMode.WriteSchema);

Use this xml file to see if the dataset is not dropping any filed or repeating any records. You can also use the same xml file in report and map the fields.

Works?

Regards,

AG.

Former Member
0 Kudos

Hum, actually, I kept on developping my report and after some manipulation with arrays it eventually got fixed by itself ...

I keep your answer in mind though, as it might strike back at some point or another.

Thanks for your help anyway !

Crystal Reports behave oddly sometimes ...

Answers (0)