I am working on a crystal report
like in the sample image. it has some limited attributes and some attributes that will be repeated. like item id will be repeated
for each item and invoice id will be only one
in the whole invoice. I am trying to use two different tables one for repeating elements and one for single time elements.
I am facing problem in setting the datasource of the crystal report
. how can I set it so that it may fetch data for repeated elements from datatable one
and other from datatable two
.
Or if you know any other approach for such problem please share.
Problem Solved. We can use as many datasources as we want. We just need to add them through database expert options. besides while giving it actual data we can do that like this:
objRpt.Database.Tables[0].SetDataSource(list_of_objects_of_data_sources);
objRpt.Database.Tables[1].SetDataSource(list_of_objects_of_data_sources2);
this also shows that we can provide data to crystal report through list of obects instead of datatables. we just need to set the references in the database expert as those class objects. like in the figure