views:

18

answers:

1

Is that possible to bind two dataset at a same time. in asp.net crystal report?

i tried bellow code.But it ask..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;
                CrystalReportViewerPrint.Visible = true;
+1  A: 

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.

Dusty
Mr Dusty:I have two dataset 1.one for invoice info..it had only one row2.second for list of bills ..have multiple rows.how to bind these 2 dataset into CR
Ayyappan.Anbalagan
See the edit to my answer and let me know if you still have issues. Thanks
Dusty