Database connectivity from application
We decide to buy FastReport, testing features and can't solve a one, but for us very big, problem. We would design datasets within a report, but a database connectivity (TIBDatabase) we can supply from application. Is it possible ???
Thanks for answer
Milan Tomes
Thanks for answer
Milan Tomes
Comments
If you mean that you use the internal (IBX based) data access components inside the report file and you wanna share the application's database handle to that internal datasets then the answer is YES. It is possible. This is the most powerful data access method I think. I also use IBX as the connectivity layer in the application and all my reports has several data access components inside the report file. They see the app's TIBDatabase component and can use it without any problem. My apps go this way for 2 and a half year and there is no problem. They also works for FireBird as well until you use any of the FB specific feature.
Regards:Alex
Yes I mean IBX components (in future IB Objects). Can you send me an example how to do that ??? I didn't wrote that IBDatabase component I create dynamically and there is no parent window so TfrIBXQuery can't see this component. Is there a way to assign Database property of TfrIBXQuery object dynamically in runtime ???
Sorry for the late. Not sure, but maybe work. This is when you don't know the names of the objects. If you know them, you canj use explicitly the Report.FindObject function with a simple type casting to TFrIBXQuery and set the appropriate property.
Var Q:TFrIBXQuery;
Begin
For I:=0 to R.Pages[0].Objects.Count-1 do
Begin
If TClass(R.Pages[0].Objects).ClassName='TFRIBXQuery' then
Begin
Q:=TFRIBXQuery(R.Pages[0].Objects);
Q.Prop:=DynamicDatabase;
OR Q.Query.Database:=DynamicDatabase;
End;
End;
End;
Regards:Alex