Mittwoch, 7. Januar 2009

Rave and the old preview...

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);
  MeinNDRStream: TMemoryStream;
  MeinNDRStream := TMemoryStream.Create;
  RvProject1.Engine := RvNDRWriter1;
  with RvNDRWriter1 do
    StreamMode := smUser;
    Stream := MeinNDRStream;
  // 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
    ScrollBox := ScrollBox1;
    NDRStream := MeinNDRStream;

 MeinNDRStream.Position := 0;
// here I use the report again for rendering into a pdf-file
// without regenerate it again ...  
  // with RenderPage you can define a page and only 
  // this page is   rendered:

To navigate in your report you have the following possibilities:

  RvRenderPreview1.LastPage := RvRenderPreview1.Pages;
  RvRenderPreview1.FirstPage := 0;

Here you get the total pages outside Rave:


Joe Trap hat gesagt…

Since you seem very familar with RAVE, I have a question.

Is it possible to load a preexisting PDF file and Print it (setting the paper size, printer, and orientation) through using any RAVE components?

thomas pfister hat gesagt…

sorry, this isn't available, but I can recommend the new PDFToolkit from There is this possible.

melphis hat gesagt…

Thomas, thank for you for exists, I love you!!!!!

michaxx hat gesagt…


what would be the best way to implement a print function in a custom preview form?

prints it, but several questions would be still open, e.g. printer selection, or printing only page 1...
Michael Bickel

Anonym hat gesagt…

I found this site using [url=][/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

Sorry for offtopic

Anonym hat gesagt…
Der Kommentar wurde von einem Blog-Administrator entfernt.
Anonym hat gesagt…

I'm from Brazil,
and come with this little note congratulating you looked all over the internet on Rave and only succeeded in showing you a simple way what I needed, I am poor have few resources (money) and I'm learning to program because of people like you and with the help of God, I am very grateful that you would give me a hand one way forward, parameters, so that I can develop further, something like handouts, tips, tricks. Something that makes me Evolve, Thanks Again!

Let me give my email to contact

Anonym hat gesagt…

Very nicce!

Anonym hat gesagt…

When is the data selected that needs to print to pdf?