Solved

Removing duplicates in cr.net

Posted on 2007-03-20
13
203 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 100

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 100

Expert Comment

by:mlmcc
ID: 18756774
Single table?

What sections and what is in the section?

Are you using a subreport?

mlmcc
0
 

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 100

Expert Comment

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

mlmcc
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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 100

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 100

Accepted Solution

by:
mlmcc earned 500 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 100

Expert Comment

by:mlmcc
ID: 18763902
Glad i could help

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

919 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now