• advertisement_alt

Crystal report shown duplicate data


6 posts in this topic

Posted (edited) · Report post

I have a code like this to display data on datagridview (si aan ugu hubiyo) and crystal reports

 

Private Sub Butt_searchInvoice(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Butt_searchInvoice.Click
                connect() 
                sql = "select  distinct SALESINVOice.[Invoice NO],[Invoice Date], " _
                    & "[Customer Name], Productname,Qty,Rate,amount from salesinvoice " _
                    & " inner join salesinvoicedetails on SALESINVOICE.[Invoice NO]= " _
                    & " salesinvoicedetails.[Invoice No] " _
                    & "where salesinvoice.[Invoice NO]   = '" & txt_invoiceNO.Text & "' "
                    objcmd = New SqlCommand(sql, objcon)
                    objda.SelectCommand = objcmd
                    Dim ds as new dataset
                    objda.Fill(ds, "stt")

                   ''displaying in datagridview
                    DataGridview1.DataSource = ds.Tables("stt")

                  ''displaying Data in Crystal report
                   Dim Path as new SalesInvoicerpt()
                   Path.Load(Application.StartupPath + "C:\SalesInvoicerpt.rpt")
                   Path.SetDataSource(ds.Tables("stt"))
                   CrystalReportViewer1.ReportSource = Path
                   CrystalReportViewer1.RefreshReport()        
                   objcon .Close 
       End Sub

Problemka i heeysto waxa waaye Crystal Reportka wixuu Mujinaayo Duplicate data. Record Walbo Labo jeer uu soo celinaaya. Halka Datagridviewga ok eey tahay wax duplicate eey san jirin... (Screenshot attached)

Query ga Join Ka Ah oo aan u sameeyay labada Table ; SQL Server xitaa waxa ku tijaabiyay waa ok.. Resultigi aan rabay an helaayaa. Wax duplictes ma lahan...

Lkn Markan ku soo bandhig maago Data da Crystal Report MA aqaan wax ka qaldan uu Duplicate u keenaayo.

 

LabadaTables Qaabka Aan iskugu xiray wa sidaan (Screenshot also attached)

 Thanks for help in advance

 

datagridview.JPG

duplicate.JPG

likn_tables.thumb.JPG.ef753980be47eb96e0

Edited by Sharma Hussein

Share this post


Link to post
La wadaag
  • advertisement_alt

Posted (edited) · Report post

 

Sharma Hussein,

walal waan test gareyey codekaga laakiin kuma arkin wax duplicate ah data da waxay iigu soo baxee si caadi ah 

waxan qaatay datada qaar ka mid ah sida table ka salesinvoicedetail ka f.thumb.PNG.3df2e880ebe6423ea0027bab589e

midka salesinvoicedetail ka waaa  sidan

d.thumb.PNG.4c4ac04a432df90696002d9e34de

markan codekaga la isticmaalay si test ah waxaaa iiso baxay sidan wax duplicate ahna uma jeedo 

ok.thumb.PNG.a189caddc97e74f270ed8232209

 

Edited by Degan
Aflixi Bar ama Baro likes this

Share this post


Link to post
La wadaag

Posted (edited) · Report post

Thanks Walal Degan. Ma aqaan aniga sababta uu Duplicate iigu keenaayo. reports ka kale waa ok. waxa jiro xitaa  Report kale isla wadadi oo kale aan maray ah wax duplicates ahna ma keenaayo si caadi u soo bexaa. kan SalesInvoice ka wax si ka ah garan la ahaysalesreceipt.thumb.JPG.948046c533b6553aa

Edited by Sharma Hussein

Share this post


Link to post
La wadaag

Posted (edited) · Report post

Sharma Hussein,Waxan filaa cilada ku heysata inay tahay formatting ka marka Waxaa highlight gareysaaa field object ga aad heysato kadib dheh right click kana dooro format object kadib waxad check saartaaa Suppress if duplicate 

Capture.thumb.JPG.0f2dfb5f3c6ea68f247549

 

Edited by Degan

Share this post


Link to post
La wadaag

Posted · Report post

Thanks Degan. Suppress If duplicated  hadan check saaro Empty rows ayaa soo baxaayo. labo record oo same Qty hadeey jiranex xita Duplicate eey u qaadane suppprees eey uu ku sameeynaa. 

Ugu dambeeyn lkn xal aan helay 

waxan furay  section expert waxan highlight gareeyay group 3 details. Next to my suppression formula entry waa ku daray  formula daaan

section_expert.thumb.JPG.e4838949c909ca6

{SalesInvoiceDetails.productname}= previous({SalesInvoiceDetails.ProductName})

Hada waa waa ok reports keyga wax duplicate ma lahan. Thanks For the tips and help.

 

Aflixi Bar ama Baro likes this

Share this post


Link to post
La wadaag

Isdiiwaan Gali

Waa inaad isdiiwaan galisaa si aad su'aal ama jawaab u soo gudbiso

Isdiiwaan Gali

Noqo Xubin si aad su'aal u soo gudbiso


Isdiiwaan Gali

Gudaha U gal

Hadii aad xubin hore eheed? Gudaha U gal


Hada Gudaha U Gal Akoonkaada

  • advertisement_alt