How do you create a custom datasource
Hello,
I saw a very interesting post named "Custom Datasource type", by danielrail, on Aug 19 2008, 11:02 AM. but to my understanding, the solution was left pending, as there was some work to do to make it available in FR.net.
I would like to know if it is already available, because I downloaded the demo version, and it is very impressive, but the business object layer is still fully preloaded and no generated on demand.
I need to be able to generate the detail on the fly, because my master data normally is around 10,000 objects, and the detail around 1,000 objects each, so preloading that information would require 10 million objects to be present in memory vs 11,000 objects if I generate the default on demand.
This is functionality I need in order to finish my new c# application and upgrade my FR studio to FR.net, as my old application (VB) uses many UserDataSets.
Thank you,
Luis Ontaneda
I saw a very interesting post named "Custom Datasource type", by danielrail, on Aug 19 2008, 11:02 AM. but to my understanding, the solution was left pending, as there was some work to do to make it available in FR.net.
I would like to know if it is already available, because I downloaded the demo version, and it is very impressive, but the business object layer is still fully preloaded and no generated on demand.
I need to be able to generate the detail on the fly, because my master data normally is around 10,000 objects, and the detail around 1,000 objects each, so preloading that information would require 10 million objects to be present in memory vs 11,000 objects if I generate the default on demand.
This is functionality I need in order to finish my new c# application and upgrade my FR studio to FR.net, as my old application (VB) uses many UserDataSets.
Thank you,
Luis Ontaneda
Comments
Please confirm if I understood you correctly:
- you work with business objects
- you register a business object by report.RegisterData(IEnumerable data, string name, BOConverterFlags flags, int maxNestingLevel) method
- you need to create master-detail report, and you want to load detail datasource on demand
That is correct.
My domain is time and attendance, so let's say I have :
1) A employee list
2) Each employee has a schedule list
3) I want to be able to report both on Employee and Employee.Schedules
4) The schedule list must be generated and bound to the detail band (or datasource) just before needed and discarded afterwards.
The reason as I stated previously is preserving resources.
Thanks.
Here is an example of how to use it (it's based on categories/products business object that is used in the demo):
As you can see, there is no event like "UnloadData". It's because FastReport does not know exactly when the data is no longer needed. So you need to unload previous data in the same LoadBusinessObject event. Something like this:
Looks good.
I'll test it as soon as it's available and I'll you know my findings.
Thank you.
Luis