Skip to Content
0
Former Member
May 28, 2008 at 07:18 PM

Change Database for Subreports using CR Rep. XI an Delphi with Advantage SQL Server !!!

14 Views

With CR Rep. 9 it was possible to change the database with this few lines in "masterreport and subreports":

<b>For i := 1 to report.Database.Tables.Count do begin

report.Database.Tables.Item<i>.ConnectionProperties.DeleteAll;

report.Database.Tables.Item<i>.ConnectionProperties.Add('User ID',UserID);

report.Database.Tables.Item<i>.ConnectionProperties.Add('Password', Password);

report.Database.Tables.Item<i>.ConnectionProperties.Add('Data Source Name',sMasterKey);

report.Database.Tables.Item<i>.ConnectionProperties.Add('Server',sMasterKey);

report.Database.Tables.Item<i>.ConnectionProperties.Add('Connection String','DSN=' + sMasterKey);

end;

</b>

in CR Rep. XI it changes only the "masterreport"

How could I change it now?

I want to change the database for every subreport without knowing the name of the subreport...

Cause the subreport ist saved "in" the report.

Many thanks for help!!!