?
Solved

Removing duplicates in cr.net

Posted on 2007-03-20
13
Medium Priority
?
214 Views
Last Modified: 2013-11-26
I am trying to display a crystal report using vb.net 2005, crystal reports.net. The data files that I use to display the data using a SELECT are .xml files. The problem is that I see duplicate rows in the report, but not in my query or in my xml files (I already have a distinct clause). Is there any way that I can suppress duplicates in crystal report.net? Any help is greatly appreciated.
0
Comment
Question by:daveg1959
  • 7
  • 6
13 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 18756514
Where are you putting the data?

What is the select?

Are you putting all the select fields on the report?

Crystal doesn't add data so there is either something wrong with the select statement or the way you are displaying the data.

For instance if you have records like
aaa   bbb   ccc   ddd   eee
aaa   bbb   ccc   ddd   fff

Crystal will see them as different but if don't display the eee & fff field they will look the same on the report.

mlmcc
0
 

Author Comment

by:daveg1959
ID: 18756626
My SELECT is something like this  
select distinct PremiumID, Certificate_Number, Date_Transfered, UserID_Transfered..........

My records get displayed in this fashion
a      b       c        e       f        g
1      2       3        4       5       6
h       i        j         k        l        m
.
.
.
.
a      b       c        e       f        g
1      2       3        4       5       6
h       i        j         k        l        m

0
 
LVL 101

Expert Comment

by:mlmcc
ID: 18756774
Single table?

What sections and what is in the section?

Are you using a subreport?

mlmcc
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:daveg1959
ID: 18756819
Yes, it's from a single table. no joins. The other sections being header, a group based on PremiumID, Page Footer and report footer The data is displayed in the details section. No sub-reports. Thanks
0
 

Author Comment

by:daveg1959
ID: 18757143
It has something to do with the binding of data to the report during run-time. My datasource returns a rowcount of 50. But, 100 rows get displayed on the report.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 18757739
How are you bindign the data source?

mlmcc
0
 

Author Comment

by:daveg1959
ID: 18758366
gDAdptrAccess1 = New SqlDataAdapter(strAccess1, gcnnAccess1)
        gDAdptrAccess1.Fill(ds, "Premium_Table")
        ds.CreateDataReader()

        myDataTable = ds.Tables("Premium_Table")
        gTAccess1 = ds.CreateDataReader(myDataTable)

             'Create a Data Definition File
        ds.WriteXmlSchema(".......xsd")
        ds.WriteXml(".....transfer.xml")

        ds.ReadXml("transfer.xml")

        'Set the dataset to be the report's data source.
       Crystal_Report_net.SetDataSource(ds)
        Crystal_Report_net.SetParameterValue("Site", gstrSite.ToString())

        viewer_net.CrystalReportViewer1.ReportSource = Crystal_Report_net
        viewer_net.CrystalReportViewer1.Zoom(100)
        viewer_net.Show()
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 18759137
Can you upload the report with saved data to
www.ee-stuff.com

mlmcc
0
 

Author Comment

by:daveg1959
ID: 18759413
The report has been uploaded
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 18759831
It looks like the data set is being saved or read twice.

I don't use you method of getting data to a report but the code looks ok.

mlmcc
0
 

Author Comment

by:daveg1959
ID: 18763171
Is there any way to suppress duplicates in cr.net
0
 

Author Comment

by:daveg1959
ID: 18763568
Yes, the data was getting read twice. I had to remove the
            ds.ReadXml("transfer.xml")

Thanks
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 18763902
Glad i could help

mlmcc
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question