Hi,
I am using crystal report for the first time an I am having some
trouble. I am using .net 2 , c# on VS 2005. I got a good recipt form
what I am trying to do is to give a summary of goods recipt using
crystal report when user finish the order. SO the user can view it and
then print it out.
I have added crystalreport.rpt in my project and in form_load methodI am using following code:
| DataTable DT = new DataTable(); |
|
|
|
|
|
|
|
|
| string msConnection = "Password=xxxx;Persist Security Info=True;User ID=xxx;Initial Catalog=SGCDB_LIVE;Data Source=xxx"; |
| |
| |
| SqlConnection con = new SqlConnection(msConnection); |
| con.Open(); |
| |
| string CmdStr = "SELECT * from SGC_STOCK where GRN = '11'"; |
| |
| |
| |
| SqlDataAdapter Adpt = new SqlDataAdapter(CmdStr,con); |
| |
| DT.Clear(); |
| |
| Adpt.Fill(DT); |
| ViewStockReceipt cp = new ViewStockReceipt(); |
| |
| cp.Database.Tables[0].SetDataSource(DT); |
| crystalReportViewer1.ReportSource = cp; |
| |
| crystalReportViewer1.Zoom(1); |
But
I run the code nothing appears on the screen. I also want to disply the
supplier detail as well on the report which is in different table. Can
any one help me
Thanks