unit ThorstenMemo<g>;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, RpDefine, RpRave, RVClass, RvProj, RVCsStd,
ClipBrd, RpCon;
type
TForm1 =
class(TForm)
RvProject1: TRvProject;
Button1: TButton;
Memo1: TMemo;
RvCustomConnection1: TRvCustomConnection;
Image1: TImage;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure RvCustomConnection1GetCols(Connection: TRvCustomConnection);
procedure RvCustomConnection1GetRow(Connection: TRvCustomConnection);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
MyPage: TRavePage;
MyText: TRaveText;
MyMemo: TRaveMemo;
MyBitmap: TRaveBitmap;
Buffer: PChar;
begin
with RvProject1.ProjMan
do
begin
MyPage := FindRaveComponent('
Report1.Page1',
nil)
as TRavePage;
MyText := FindRaveComponent('
Text2', MyPage)
as TRaveText;
MyMemo := FindRaveComponent('
Memo1', MyPage)
as TRaveMemo;
MyBitmap := FindRaveComponent('
Bitmap2', MyPage)
as TRaveBitmap;
MyText.Text := '
hallo teneriffa!';
MyText.Color := clRed;
GetMem(Buffer, Length(Memo1.Text) + 1);
StrCopy(Buffer, PChar(Memo1.Text));
MyMemo.Text := Buffer;
FreeMem(Buffer);
MyBitmap.Image.Assign(Image1.Picture.Bitmap);
end;
RvProject1.ExecuteReport('
Report1');
RvProject1.Close;
end;
procedure TForm1.RvCustomConnection1GetCols(
Connection: TRvCustomConnection);
begin
Connection.WriteField('
FieldText1', dtString, 30, '
', '
');
Connection.WriteField('
FieldMemo1', dtMemo, 30, '
', '
');
end;
procedure TForm1.RvCustomConnection1GetRow(Connection: TRvCustomConnection);
var
s:
string;
Buffer: PChar;
begin
s := '
Meine Info für das Textfeld';
Connection.WriteStrData('
', S);
GetMem(Buffer, Length(Memo1.Text) + 1);
StrCopy(Buffer, PChar(Memo1.Text));
Connection.WriteBlobData(Buffer^, Length(Memo1.Text));
FreeMem(Buffer);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
RvProject1.ExecuteReport('
Report1');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
RvProject1.Open;
end;
end.