Solved

Removing duplicates in cr.net

Posted on 2007-03-20
13
202 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

11 Experts available now in Live!

Get 1:1 Help Now