By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,281 Members | 2,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,281 IT Pros & Developers. It's quick & easy.

Hi,Problem in crystal report

ranjana1980
P: 15
Here Sample Of my crystal Report Using Eg
In My crystal report,I retrieve data from two tables using sql-server using this code
Expand|Select|Wrap|Line Numbers
  1. con.ConnectionString = "Data Source=XPO3;Initial Catalog=Imsapplication;Integrated Security=True";
  2. con.Open();
  3.  adp1 = new SqlDataAdapter("select * from phototab", con);
  4.             DataSet ds1 = new DataSet();
  5.  adp1.Fill(ds1, "phototab");
  6. adp2 = new SqlDataAdapter("select distinct Id,addr from addtab", con);
  7.  adp2.Fill(ds1, "addtab");
  8. CrystalReport6 rp = new CrystalReport6();
  9.  rp.Load("CrystalReport6.rpt");
  10.  rp.SetDataSource(ds1);
  11.  crystalReportViewer1.ReportSource = rp;
  12. In Table Phototab field is
  13. Id(Primary Key)
  14. Name
  15. Photo
  16. In Table addtab Field is
  17. Id(Foreign Key)
  18. Addr
In addtab I have Multiple Id of different address
eg Id Addr
1 sfsf
1 fdgsdd
2 dgdgd
2 fdgfdgd
which i want to retrieve in crystal report
for eg table record like this
Id Qualification Univ Precentage
1 10th Mp Board 55
1 12th MP Board 65
2 10th MP Board 77
2 12th MP Board 66
2 graduation DAVV 66
But from above code for Each Id we get repetition of record of table one with record of table 2
how to resolve it
Jul 14 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.