Solved

Removing duplicates in cr.net

Posted on 2007-03-20
13
204 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

DevOps Toolchain Recommendations

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

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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