Page 1 of 1
two datasources
Posted: Mon Jan 04, 2010 5:39 am
by Sundara Manikandan
Hi,
Is it possible to register two different datasources using RegData. ie.,
databand1.RegData(....);
databand2.RegData(....);
Very Urgent.
two datasources
Posted: Mon Jan 04, 2010 7:08 am
by Edward
Hi
Yes, that is possible.
report.RegData(MyDataSet1);
report.RegData(MyDataSet2);
report.CacheAllData = true;
(report.GetComponents()["MyDataBand1"] as StiDataBand).DataSourceName = "MyDataSourceName";
Thank you.
two datasources
Posted: Thu Jan 07, 2010 3:53 am
by Sundara Manikandan
Hi,
I have done as you instructed.
I am attaching the code for your inspection.
Code:
BillmasterEntity bill = new BillmasterEntity(2);
PredicateExpression filter = new PredicateExpression();
filter.Add(BillmasterFields.Id == 2);
//tlBillDetail.Fill(0,null,false,filter);
CustomerEntity customer = new CustomerEntity(bill.Customerid);
billTransTypedList.Fill(0, null, true, filter);
StiReport report = StiReport.GetReportFromAssembly("rpBill.dll",true);
report.RegData("customer", customer);
report.RegData("BillMaster", bill);
report.RegData("BillTrans", billTransTypedList);
//DataBand Name is BillHeadBand
(report.GetComponents()["BillHeadBand"] as StiDataBand).DataSourceName = "BillMaster";
//DataBand Name is BillMasterBand
(report.GetComponents()["BillMasterBand"] as StiDataBand).DataSourceName = "customer";
//DataBand Name is BillTransBand
(report.GetComponents()["BillTransBand"] as StiDataBand).DataSourceName = "BillTrans";
report.PreviewControl = stiPreviewControl1;
report.Show();
I get no results in the report (Empty Report).
I have verified that all my business objects return data.
Please guide me in this regard.
two datasources
Posted: Thu Jan 07, 2010 12:43 pm
by Andrew
Hello,
It is hard to say something just having your code. Please send us a report sample to
support@stimulsoft.com.
Thank you.
two datasources
Posted: Thu Jan 07, 2010 10:50 pm
by Sundara Manikandan
//DataBand Name is BillHeadBand
(report.GetComponents()["BillHeadBand"] as StiDataBand).DataSourceName = "BillMaster";
//DataBand Name is BillMasterBand
(report.GetComponents()["BillMasterBand"] as StiDataBand).DataSourceName = "customer";
//DataBand Name is BillTransBand
(report.GetComponents()["BillTransBand"] as StiDataBand).DataSourceName = "BillTrans";
I removed these lines and tried to run the report.
Only the first registered data is displayed in the report. i.e.,
report.RegData("customer", customer);
report.RegData("BillMaster", bill);
report.RegData("BillTrans", billTransTypedList);
In this case, only the customer details is displayed. If I change the order say:
report.RegData("BillMaster", bill);
report.RegData("customer", customer);
report.RegData("BillTrans", billTransTypedList);
the bill master details are displayed.
two datasources
Posted: Fri Jan 08, 2010 5:37 am
by Edward
Hi,
Please try to add report.Dictionary.Synchronize() command after RegData()
If you still face problems, sample project could be very helpful to speed up resolving of the issue.
Please send it to support[at]stimulsoft.com for analysis.
Thank you.
two datasources
Posted: Mon Jan 11, 2010 1:21 am
by Sundara Manikandan
Thanks for your patience.
I have worked around the problem using variables.:byebye:
two datasources
Posted: Mon Jan 11, 2010 4:56 am
by Edward
Hi,
Please let us know if you need any help.
Thank you.