Solved

Delphi 7 and included RAVE 5.0, getting report directly to PDF

Posted on 2007-03-19
5
3,317 Views
Last Modified: 2012-06-27
I've read several solutions here about this but none work.  Read carefully!

I've read all the documentation available for RAVE.  No help.

I want to send my existing RAVE report directly to PDF.  I can do this manually by running the report, telling it to save to a file and picking PDF.  This works great EXCEPT I need to do this all programatically; as in no user intervention.  

The PDF converter is included with RAVE as a component you drop on your form. I've got that so I DON'T NEED EXTERNAL PDF CONVERSION SOFTWARE!

I need to know how to automate what is included with Delphi 7 and RAVE 5 to make this happen!

Thanks!
0
Comment
Question by:digitalwav
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:jpedef
Comment Utility
Following code creates pdf-file.

  RVProject1.ProjectFile := 'C:\Project1';
  RvSystem1.SystemSetups := RvSystem1.SystemSetups - [ssAllowSetup];
  RvSystem1.SystemOptions := RvSystem1.SystemOptions - [soShowStatus];
  RvSystem1.RenderObject := RvRenderPDF1;
  RvSystem1.DefaultDest := rdFile;
  RVProject1.ExecuteReport('Report1');
  RvRenderPDF1.PrintRender(RvSystem1.Stream, 'C:\RaveTest.pdf');

You can also generate report to ndr-file by using TRvNdrWriter component and then rendering this file with TRvRenderPdf component.
0
 
LVL 1

Author Comment

by:digitalwav
Comment Utility
Perfect except for one thing...it kicked out a hard copy on the printer too...How do I get it to not print?

BTW- how did you figure all that out? Is this documented somewhere?
0
 
LVL 3

Accepted Solution

by:
jpedef earned 500 total points
Comment Utility
Modified and corrected example from nevronas site
http://www.nevrona.com/Default.aspx?tabid=180

procedure TForm1.Button1Click(Sender: TObject);
var
  NdrStream: TMemoryStream;
  OutStream: TMemoryStream;
begin
  RVProject1.ProjectFile := 'C:\Project1';
  RVProject1.SelectReport('Report1', true);
  RvProject1.Engine := RvNDRWriter1;
  NdrStream := TMemoryStream.Create;
  OutStream := TMemoryStream.Create;
  try
    RvNDRWriter1.StreamMode := smUser;
    RvNDRWriter1.Stream := NdrStream;
    RVProject1.Execute;
    RvRenderPDF1.OutputStream := OutStream;
    RvRenderPDF1.Render(NdrStream);
    OutStream.SaveToFile('C:\RaveTest.pdf');
  finally
    FreeAndNil(NdrStream);
    FreeAndNil(OutStream);
  end;
end;
0
 
LVL 1

Author Comment

by:digitalwav
Comment Utility
Perfect, even faster than the other!!
0
 
LVL 1

Author Comment

by:digitalwav
Comment Utility
Didn't realize Nevrona had an online system, I'll start hunting there for all the other little issues.  Thanks again!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now