Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Crystal Report Displaying multiple data (Each row twice) .

Crystal Report Displaying multiple data (Each row twice) .

Scheduled Pinned Locked Moved C#
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aashish saalvi
    wrote on last edited by
    #1

    Hi I am generating an report by using crystal report and access database in C#. the code which i have writeen works fine, but it displays multiple records. that is if there are two records to display it displays four records i.e it displays each record twice. i have executed the queries on the page load event in an dataset & binded that dataset to crystal report str1,str2,str3,str4 are the variables declared within constructor.the code i have written is displayed below. Thanks in advance. private void ViewPSDClearedReport_Load(object sender, EventArgs e) { try { crystalReportViewer1.DisplayGroupTree = false; if (str3 == "All") { //IF NO PURCHASE GROUP IS SELECTED MessageBox.Show("All"); ds = new DataSet(); rpt = new PSDClearedCrystalReport(); con = new OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data Source=e:/Ashish/Practice/ContractSystem/ContractSystem/ContractSystemDB.mdb"); con.Open(); cmd = new OleDbCommand("select * from PSDApproval where InitialPSD='" + str4 + "' and FwdDtByPSD between '" + str1 + "' and '" + str2 + "' order by FwdDtByPSD", con); rd = cmd.ExecuteReader(); if (rd.HasRows) { MessageBox.Show("Record present so reading"); while (rd.Read()) { string pr; pr = rd.GetString(0); MessageBox.Show("PR==" + pr); da = new OleDbDataAdapter("select PrNo,Description,ValueQuoted,PurchaseGrp,RcdDtEA,FwdDtPSD,Initial from InitialApproval where InitialApproval.PrNo='" + pr + "'", con); da.Fill(ds, "InitialApproval"); da.Dispose(); da1 = new OleDbDataAdapter("select EstimatedVal,FwdDtByPSD from PSDApproval where PSDApproval.PrNo='" + pr + "'", con); da1.Fill(ds, "PSDApproval"); da1.Dispose(); } } rpt.SetDataSource(ds); crystalReportViewer1.ReportSource = rpt; MessageBox.Show("Record Added To Report"); } else {

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups