Home DADE

Data Design

edited November 2002 in DADE
I've built a wizard for creating reports. This wizard is generic in that
it could act as a front end to any reporting engine - RB, Rave, Crystal,
etc. The end result is a data structure that describes a generic report.
So far so good.

My next step is to take that generic data structure, and create a RB
report from it. I've been successful in this by using the example in the
Developer's Guide entitled "Creating Reports in Code" (page 83).

However, I would like the user to be able to fine tune the report by
using the TppDesigner component. This is where I'm lost. My guess is
that I have to:
1. Create a ADO Connection for the database.
2. Somehow tell the TppDesigner component to use that database.
3. Add the tables listed in the generic data structure to the SQL object
in the report.
4. Add fields, joines, criteria, etc to the SQL object.

Am I on the right track? This is what I have so far:

var
designer: TppDesigner;
cnc: TADOConnection;
begin
cnc := TADOConnection.Create(nil);
cnc.ConnectionString := 'Provider=OraOLEDB.Oracle.1;Data
Source=db;User ID=userID;Password=password';
cnc.Name := 'dbConnection';
cnc.LoginPrompt := false;
cnc.Open;

designer := TppDesigner.Create(nil);
try
designer.AllowDataSettingsChange := true;
designer.DataSettings.AllowEditSQL := true;

designer.DataSettings.CollationType := ctANSI;
designer.DataSettings.DatabaseName := 'dbConnection';
designer.DataSettings.DatabaseType := dtOracle;
designer.DataSettings.SessionType := 'ADOSession';
designer.DataSettings.SQLType := sqSQL1;
designer.DataSettings.UseDataDictionary := false;

designer.AllowSaveToFile := false;
designer.Report := TppReport.Create(nil);
designer.ShowModal;
finally
designer.Free;
end;
end;


Thanks in advance,

Ed Vander Hoek

Comments

This discussion has been closed.