Click here to Skip to main content
15,886,872 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
here is my sql query:

SELECT p.[Plot/Flat_No],p.Sector,p.[Street/Block],a.Alotee_Name,t.Trans_Name from Tbl_Property p, Tbl_Allotee a, Tbl_Transferee t where p.[Plot/Flat_No]='{0}' AND a.Plot_Id=p.ID AND t.Plot_Id=p.ID"

I got my required data in datatable from this query, but doesn't showing in crystal report..!!
I need step by step procedure..!!
using asp.net, c#, SQL, visiual studio 2010.
Thanks..!!
Posted
Comments
[no name] 19-Sep-14 19:54pm    
"I need step by step procedure..!!", then search for one !! There are thousands of them out there !! You just need to go look !!

1 solution

Go through this article.It explains step by Step Creation of Crystal Report using its Features Group, Graph, Cross-Tab and Sub Report.

Step by Step Creation of Crystal Report using its Features Group, Graph, Cross-Tab and Sub Report
 
Share this answer
 
v3
Comments
shehzad82 20-Sep-14 6:59am    
Not Helpful, I'm somehow newbie,
here I got required table in 'dt' which use where clause in sql query but not able to pass it to crystal report,

DataTable dt = new DataTable();
dt = FghBAL.Report.Get_Data_by_Plot(txt_search_plot.Text);

here is my code.

ReportDocument rptPlot = new ReportDocument();
string reportPath = Server.MapPath("cryPlot.rpt");
rptPlot.Load(reportPath);
rptPlot.SetDataSource(dt);
CrystalReportViewer2.Visible = true;
rptPlot.SetParameterValue("Plot", txt_search_plot.Text);
CrystalReportViewer2.ReportSource = rptPlot;

I alter this code many ways but didn't get my required result in CR, Problem is
1. CR show whole table data (but doesn't show data which is in 'dt')
2. OR doesn't show any thing.
Dilan Shaminda 20-Sep-14 8:47am    
Create a DataSet as shown in the above mentioned tutorial. Then inside your code Make an object from it.

set DataSource like this rptPlot.SetDataSource(ds); use your DataSet not your DataTable

i have modified your code

ReportDocument rptPlot = new ReportDocument();
DataTable dt = new DataTable();
dt.TableName = "Crystal Report Example";
dt = FghBAL.Report.Get_Data_by_Plot(txt_search_plot.Text);
MyDataSet ds = new MyDataSet();
ds.Tables[0].Merge(dt); //Merge your DataTable
string reportPath = Server.MapPath("cryPlot.rpt");
rptPlot.Load(reportPath);
rptPlot.SetDataSource(ds);
rptDoc.DataSourceConnections.Clear();
rptPlot.SetParameterValue("Plot", txt_search_plot.Text);
CrystalReportViewer2.ReportSource = rptPlot;
CrystalReportViewer2.Visible = true;
shehzad82 20-Sep-14 11:57am    
Bundles of Thanks @Dilan Shaminda.
Finally I got my clue after one week.
Dilan Shaminda 20-Sep-14 11:58am    
You are welcome :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900