connecting fastreport to the main uniconnection in delphi project

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ali.Mustapha
Posts: 7
Joined: Fri 02 May 2014 13:37

connecting fastreport to the main uniconnection in delphi project

Post by Ali.Mustapha » Fri 02 May 2014 13:51

hello ,
im using unidac in Delphi XE2 and unidac components for fastreport , everything is going ok , only I have one problem which is that when I add unitable or uniquery I need the database property to show me the main uniconnection of my project , same as BDE components for fastreport.
I don't want to put in every report unidac database and put all of its properties.
thanks in advance.

Ali.Mustapha
Posts: 7
Joined: Fri 02 May 2014 13:37

Re: connecting fastreport to the main uniconnection in delphi project

Post by Ali.Mustapha » Fri 02 May 2014 20:14

i found the solution , its just very simple !!!
specify the default database in the fastrepot unidac components

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: connecting fastreport to the main uniconnection in delphi project

Post by AlexP » Mon 05 May 2014 13:13

Hello,

Glad to see that the issue was resolved. If you have any further questions, feel free to contact us.

Ali.Mustapha
Posts: 7
Joined: Fri 02 May 2014 13:37

Re: connecting fastreport to the main uniconnection in delphi project

Post by Ali.Mustapha » Wed 17 Sep 2014 13:42

hello alexp
I just have another question , why i cant choose another database within the fastreport , i have two uniconnections in my application which connect to different databases but in some reports i want to use queries from the two databases , but i cant , because only one database is shown in fast report which is the one i choosed to be the default database in frxUniDACComponents1.

i hope i explained well my problem.
hope to hear from you soon.
thanks in advance.

stevel
Posts: 125
Joined: Tue 02 Nov 2010 19:01

Re: connecting fastreport to the main uniconnection in delphi project

Post by stevel » Wed 17 Sep 2014 22:27

Ali.Mustapha wrote:hello alexp
I just have another question , why i cant choose another database within the fastreport , i have two uniconnections in my application which connect to different databases but in some reports i want to use queries from the two databases , but i cant , because only one database is shown in fast report which is the one i choosed to be the default database in frxUniDACComponents1.

i hope i explained well my problem.
hope to hear from you soon.
thanks in advance.
Depending on how you want to deploy your application, the following may or may not work for you:

I'm using FastReport Professional 5.1 / UniDAC Professional 5.5.11 / Delphi XE2

Use the TfrxDBDataSet component. Then you can link this to any UniDAC dataset via the DataSet property. So if you have 2 UniQuery on your data module (one for each UniConnection), and if you want to switch the database at runtime, then for your frxDBDataSet component, you simply change the DataSet property to point to the correct UniQuery, and then re-open the report. The report (TfrxReport) is linked to the frxDBDataSet from inside (menu Report->Data).


--
Steve Faleiro

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: connecting fastreport to the main uniconnection in delphi project

Post by AlexP » Mon 22 Sep 2014 11:47

Please clarify where you can't add frxUniDACComponents1, and where in FastReport you want to see several Connections.

Ali.Mustapha
Posts: 7
Joined: Fri 02 May 2014 13:37

Re: connecting fastreport to the main uniconnection in delphi project

Post by Ali.Mustapha » Tue 28 Oct 2014 11:17

hi alex and Steve Faleiro,
sorry for the late in the reply , but I was in my annual vacation.
the problem that in fastreport when I add unidacquery it automatically select the Database property which is linked to the frxUniDACComponents1 default database property , which is very useful if I have one uniconnection in my app , but I have two uniconnection each one linked to different databases ( one local and the another is over network ) , in some reports I want to use both connections inside the fast report and not inside Delphi ( because in Delphi I can solve this issue but for end users who want to edit the reports it is not useful ).
so the solution must be that when I drop unidacquery in my report it must allow me to choose between the two connections.

sorry again for the late in the reply.
thanks for your help.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: connecting fastreport to the main uniconnection in delphi project

Post by AlexP » Wed 29 Oct 2014 08:35

Unfortunately, such behavior is not supported. You should use TfrxDBDataSet as stevel had recommended.

Post Reply