Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: crystal starter Post Reply Post New Topic
Author Message
xfahad
Newbie
Newbie


Joined: 12 Nov 2008
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote xfahad Replybullet Topic: crystal starter
    Posted: 12 Nov 2008 at 6:03am
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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.