MyDac FastReport component is obsolete
MyDac FastReport component is obsolete
I donwloaded the last version of MyDac and realized that the code of the FastReport component (demo folder) is obsolete.
The TfrxMYDACDatabase object is not of the correct type. I had to change the declaration a little bit. Maybe you can correct this in the next MyDac release. Here below is the modified code (frMyDacComponents.pas):
TfrxMYDACDatabase = class(TfrxDialogComponent)
private
FConnection: TMyConnection;
protected
function GetLoginPrompt: Boolean;
procedure SetLoginPrompt(Value: Boolean);
function GetDatabaseName: string;
procedure SetDatabaseName(const Value: string);
function GetPort: integer;
procedure SetPort(Value: integer);
function GetUsername: string;
procedure SetUsername(const Value: string);
function GetPassword: string;
procedure SetPassword(const Value: string);
function GetServer: string;
procedure SetServer(const Value: string);
function GetConnected: Boolean;
procedure SetConnected(Value: Boolean);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
class function GetDescription: String; override;
procedure SetLogin(const Login, Password: String);
property Connection: TMyConnection read FConnection;
published
property LoginPrompt:Boolean read GetLoginPrompt write SetLoginPrompt default True;
property DatabaseName: String read GetDatabaseName write SetDatabaseName;
property Port: integer read GetPort write SetPort default MYSQL_PORT;
property Username: string read GetUsername write SetUsername;
property Password: string read GetPassword write SetPassword;
property Server: string read GetServer write SetServer;
property Connected: Boolean read GetConnected write SetConnected default False;
end;
The TfrxMYDACDatabase object is not of the correct type. I had to change the declaration a little bit. Maybe you can correct this in the next MyDac release. Here below is the modified code (frMyDacComponents.pas):
TfrxMYDACDatabase = class(TfrxDialogComponent)
private
FConnection: TMyConnection;
protected
function GetLoginPrompt: Boolean;
procedure SetLoginPrompt(Value: Boolean);
function GetDatabaseName: string;
procedure SetDatabaseName(const Value: string);
function GetPort: integer;
procedure SetPort(Value: integer);
function GetUsername: string;
procedure SetUsername(const Value: string);
function GetPassword: string;
procedure SetPassword(const Value: string);
function GetServer: string;
procedure SetServer(const Value: string);
function GetConnected: Boolean;
procedure SetConnected(Value: Boolean);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
class function GetDescription: String; override;
procedure SetLogin(const Login, Password: String);
property Connection: TMyConnection read FConnection;
published
property LoginPrompt:Boolean read GetLoginPrompt write SetLoginPrompt default True;
property DatabaseName: String read GetDatabaseName write SetDatabaseName;
property Port: integer read GetPort write SetPort default MYSQL_PORT;
property Username: string read GetUsername write SetUsername;
property Password: string read GetPassword write SetPassword;
property Server: string read GetServer write SetServer;
property Connected: Boolean read GetConnected write SetConnected default False;
end;
-
Guest
I downloaded the last version of MyDac.
"Demo for FastReport included in MyDAC was built and tested using
Fast Report 3.20". That is what is written in your readme.txt file, however it didn't work for me.
As before, I had to modify the code. Why are you still using the obsolete "TfrxCustomDatabase" class instead of the new "TfrxDialogComponent" class ? Can't you just copy my code and fix this once for all ?
Another problem is that you still don't provide dpk file for Delphi 2005 and Delphi 2006. Is it so difficult to create and provide these files ?
I feel all this a little bit irritating.
"Demo for FastReport included in MyDAC was built and tested using
Fast Report 3.20". That is what is written in your readme.txt file, however it didn't work for me.
As before, I had to modify the code. Why are you still using the obsolete "TfrxCustomDatabase" class instead of the new "TfrxDialogComponent" class ? Can't you just copy my code and fix this once for all ?
Another problem is that you still don't provide dpk file for Delphi 2005 and Delphi 2006. Is it so difficult to create and provide these files ?
I feel all this a little bit irritating.
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
no...
I'm a registered user of FastReport, the last version Stable is 3.20mvalent wrote:Version is 3.19 (last available)
-
swierzbicki
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59
I see. Yes I am using the last version 3.20.
I am not very sure if "TfrxCustomDatabase" class or "TfrxDialogComponent" class should be used. It looks that in the FastReport documentation it is "TfrxDialogComponent".
The main problem I face now is that the TfrxMyDacX classes are missing in the classes list in FastReport. The result is that I cannot use the query components in scripts in FastReport.
I am not very sure if "TfrxCustomDatabase" class or "TfrxDialogComponent" class should be used. It looks that in the FastReport documentation it is "TfrxDialogComponent".
The main problem I face now is that the TfrxMyDacX classes are missing in the classes list in FastReport. The result is that I cannot use the query components in scripts in FastReport.
the solution is here
unit frxMYDACRTTI;
interface
{$I frx.inc}
implementation
uses
Windows, Classes, fs_iinterpreter, frxMYDACComponents
{$IFDEF Delphi6}
, Variants
{$ENDIF};
type
TFunctions = class(TfsRTTIModule)
private
function CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; var Params: Variant): Variant;
public
constructor Create(AScript: TfsScript); override;
destructor Destroy; override;
end;
var
Functions: TFunctions;
{ TFunctions }
constructor TFunctions.Create(AScript: TfsScript);
begin
inherited Create(AScript);
with AScript do
begin
AddClass(TfrxMYDACDatabase, 'TfrxCustomDatabase');
AddClass(TfrxMYDACTable, 'TfrxCustomTable');
with AddClass(TfrxMYDACQuery, 'TfrxCustomQuery') do
AddMethod('procedure ExecSQL', CallMethod);
end;
end;
destructor TFunctions.Destroy;
begin
if fsGlobalUnit nil then
fsGlobalUnit.RemoveItems(Self);
inherited;
end;
function TFunctions.CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; var Params: Variant): Variant;
begin
Result := 0;
if ClassType = TfrxMYDACQuery then
begin
if MethodName = 'EXECSQL' then
TfrxMYDACQuery(Instance).Query.Execute;
end
end;
initialization
fsRTTIModules.Add(TFunctions);
end.
interface
{$I frx.inc}
implementation
uses
Windows, Classes, fs_iinterpreter, frxMYDACComponents
{$IFDEF Delphi6}
, Variants
{$ENDIF};
type
TFunctions = class(TfsRTTIModule)
private
function CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; var Params: Variant): Variant;
public
constructor Create(AScript: TfsScript); override;
destructor Destroy; override;
end;
var
Functions: TFunctions;
{ TFunctions }
constructor TFunctions.Create(AScript: TfsScript);
begin
inherited Create(AScript);
with AScript do
begin
AddClass(TfrxMYDACDatabase, 'TfrxCustomDatabase');
AddClass(TfrxMYDACTable, 'TfrxCustomTable');
with AddClass(TfrxMYDACQuery, 'TfrxCustomQuery') do
AddMethod('procedure ExecSQL', CallMethod);
end;
end;
destructor TFunctions.Destroy;
begin
if fsGlobalUnit nil then
fsGlobalUnit.RemoveItems(Self);
inherited;
end;
function TFunctions.CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; var Params: Variant): Variant;
begin
Result := 0;
if ClassType = TfrxMYDACQuery then
begin
if MethodName = 'EXECSQL' then
TfrxMYDACQuery(Instance).Query.Execute;
end
end;
initialization
fsRTTIModules.Add(TFunctions);
end.
Yes. Solution is from oquz... 
However, it didn't completely solve my problem...
Now the TfrxMyDac classes are appearing in the classes list in FastReport and I can run the report inside the Delphi IDE with success. But at design time when I run my application I still get the weird message "Class Exception : Unknown type TfrxMYDACQuery".
Any idea oquz ?
-marc-
However, it didn't completely solve my problem...
Now the TfrxMyDac classes are appearing in the classes list in FastReport and I can run the report inside the Delphi IDE with success. But at design time when I run my application I still get the weird message "Class Exception : Unknown type TfrxMYDACQuery".
Any idea oquz ?
-marc-