two datasources

Stimulsoft Reports.NET discussion
Post Reply
Sundara Manikandan
Posts: 14
Joined: Tue Dec 29, 2009 11:21 pm
Location: Chennai

two datasources

Post by Sundara Manikandan »

Hi,

Is it possible to register two different datasources using RegData. ie.,

databand1.RegData(....);
databand2.RegData(....);

Very Urgent.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

two datasources

Post 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.
Sundara Manikandan
Posts: 14
Joined: Tue Dec 29, 2009 11:21 pm
Location: Chennai

two datasources

Post 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.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

two datasources

Post 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.
Sundara Manikandan
Posts: 14
Joined: Tue Dec 29, 2009 11:21 pm
Location: Chennai

two datasources

Post 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.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

two datasources

Post 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.
Sundara Manikandan
Posts: 14
Joined: Tue Dec 29, 2009 11:21 pm
Location: Chennai

two datasources

Post by Sundara Manikandan »

Thanks for your patience.

I have worked around the problem using variables.:byebye:

Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

two datasources

Post by Edward »

Hi,

Please let us know if you need any help.

Thank you.
Post Reply