Is that possible to bind two dataset at a same time in crystal report?
Is that possible to bind two dataset at a same time in asp.net crystal report?
I tried the code below, but it asks for server details:
Invoice inv = new Invoice();
inv.OrgId = Session["org_id"].ToString();
inv.InvoiceId = invoiceId.ToString();
ds = _reportController.ReportPrintBillView(inv);
dtBill=ds.Tables[0];
dtInvoice = ds.Tables[1];
ReportDocument myRpt = new ReportDocument();
myRpt.Load(Server.MapPath("PrintandprintBill.rpt"));
myRpt.SetDatabaseLogon("root", "root", "localhost", "hemaepdb");
myRpt.SetDataSource(dtBill);
myRpt.SetDataSource(dtInvoice);
CrystalReportViewerPrint.ReportSource = myRpt;
CrystalRe开发者_如何学GoportViewerPrint.Visible = true;
No, the report accepts one datasource. However your subreports may have a different datasource.
EDIT:
If you need data from two different datasets that have similar data you might try to combine the data into one dataset. Even if some of the data duplicates, you can then create groups and use the suppress functionality to only show and format the data in the way you need to see it. See my answer here for a better explanation of the grouping and suppressing that I am referring to.
From ur Requirement i think u want to use View. View is one kind of logical table that maps other columns from different tables. And at Datable just use View Name and add this datatable to dataset. simply SetDataSource to dataset.
精彩评论