Moving data from multiple tables in Crystal Report

I have a crystal report called CR1. Now I want to populate data from several tables in my Crystal CR1 report. I am using VS2008 and the coding language is C # in ASP.net Any help would be appreciated.

+4
source share
2 answers

Create a stored procedure , and then use it as the data source of your report. This will help.

+1
source
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); DataSet ds; protected void Page_Load(object sender, EventArgs e) { ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter("select Table1.Col1,Table2.Col2,Table3.Col3 From Table1,Table2,Table3 where Table1.id=Table2.id and Table2.id=Table3.id", con); da.Fill(ds); CrystalDecisions.CrystalReports.Engine.ReportDocument myReportDocument; myReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); myReportdocument.Load(@"MyPathToReportFile.rpt"); myReportdocument.Database.Tables[0].SetDataSource(ds); CrystalReportViewer1.ReportSource = myReportDocument; CrystalReportViewer1.DataBind(); } 
0
source

Source: https://habr.com/ru/post/1398529/


All Articles