Solved

Removing duplicates in cr.net

Posted on 2007-03-20
13
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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 100

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 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

749 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