I am trying to begin with crystal report but it is hard for me to understand . I do not know how to bind data to crystal report . I do not want to create report in wizard . What i have done is :
- First , i create a blank crystal report . (report1.rpt)
- Second , i create a form with a crystalreportview (Crystal1)
The problem here is that i do not know how to complete with report1.rpt designer : i can not add fields to report (fields from a table from sqlserver database )
Forexample , i design a report formed :
GOODS LIST
-------------------------------------------------------------------------------------------------------------------------------------------------------
Code Name Unit Description
-------------------------------------------------------------------------------------------------------------------------------------------------------
HH001 TV Samsung 21 Inches
HH002 TV LG 32 inches
The report in designer :
GOODS LIST
-------------------------------------------------------------------------------------------------------------------------------------------------------
Code Name
Unit Description
-------------------------------------------------------------------------------------------------------------------------------------------------------
Goods_Code Goods_Name Goods_Unit Goods_Description
Can you give the way to do with some fileds ( Goods_code,goods_name,goods_unit ,,....) .
Loading
Marimuthu ArigovindasamyPosted Jun 25, 2010, 12:09 AM
//Begin: Bind the reports dynamically
DataTable dtReports = BindReports();
rpt.SetDataSource(dtReports);
//End: Bind the reports dynamically
//Begin: Update the report label value from All to the entered employee name in the text box
TextObject myTextObjectOnReport;
if (rpt.ReportDefinition.ReportObjects["txtEmpName"] != null)
{
myTextObjectOnReport = (TextObject)rpt.ReportDefinition.ReportObjects["txtEmpName"];
myTextObjectOnReport.Text = txtName.Text;
}
crystalReportViewer1.ReportSource = rpt;
crystalReportViewer1.Refresh();
//End
MinhPosted Jun 24, 2010, 10:18 PM
Marimuthu ArigovindasamyPosted Jun 22, 2010, 8:04 PM
1. Right click from report
2. Database --> DatabaseExpert
3. Expand "Create New Connection"
4. Expand OLEDB (ADO)
5. Select "Microsoft OLEDB provider for SQL Server" then click "Next"
6. Give the database credentials and click Next and then Finish(Click check box Integrated Security for windows authentication)
7. Select the table from Database Expert window then click OK
8. Expand Database fields from Field Explorer
9. Drag and drop the Table field inside the Details section.
10. To change the font style right click from the field and click format object and change ur font style in Font Tab and click OK
Dynamically set the Datasource into report viewer:
http://www.c-sharpcorner.com/UploadFile/MuthuA/1640/?ArticleID=b7d43f06-4403-407e-bdf1-1b9a78307082