Print Page | Close Window

crystal starter

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4777
Printed Date: 17 May 2024 at 7:53pm


Topic: crystal starter
Posted By: xfahad
Subject: crystal starter
Date 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



Print Page | Close Window