Rave have since version 3 the same preview-form. Many users of Rave don't understand why it's not with a newer design available.
First the BEX users have the complete source and on the other side (for BE-users and corporate-design-developers) you have with Delphi and Rave all the flexibility you need for your own preview in your application-form, with your look&feel.
In the following example you see how easy an own preview in your form is:
You must only insert a TScrollBox from Delphi and instead of the RvSystem the RvNDRWriter for the engine of your RvProject. To render the report into the scrollBox you need the RvRenderPreview-component from the Rave-register;
you can insert the componenta on your form or create on runtime:
RvRenderPreview1: TRvRenderPreview;
RvNDRWriter1: TRvNDRWriter;
RvRenderPreview1 := TRvRenderPreview.Create(Self);
RvNDRWriter1 := TRvNDRWriter.Create(Self);
Now you can show the report inside your application and don't need a special (old) form ...
procedure TForm1.Button2Click(Sender: TObject);
var
MeinNDRStream: TMemoryStream;
begin
MeinNDRStream := TMemoryStream.Create;
RvProject1.Open;
RvProject1.Engine := RvNDRWriter1;
with RvNDRWriter1 do
begin
StreamMode := smUser;
Stream := MeinNDRStream;
end;
RvProject1.Execute;
// the report is now written into the TMemoryStream;
// you can use the report for many things without regenerate
// the report again!
// e.g. preview, print and render into PDF/HTML or whatelse
MeinNDRStream.Position := 0;
with RvRenderPreview1 do
begin
ScrollBox := ScrollBox1;
NDRStream := MeinNDRStream;
Render;
end;
MeinNDRStream.Position := 0;
// here I use the report again for rendering into a pdf-file
// without regenerate it again ...
RvRenderPDF1.PrintRender(MeinNDRStream,'c:\hello_world.pdf');
// with RenderPage you can define a page and only
// this page is rendered:
RvRenderpdf1.RenderPage(1);
end;
To navigate in your report you have the following possibilities:
RvRenderPreview1.PrevPage;
RvRenderPreview1.NextPage;
RvRenderPreview1.LastPage := RvRenderPreview1.Pages;
RvRenderPreview1.FirstPage := 0;
Here you get the total pages outside Rave:
RvRenderPreview1.Pages