Question

I apologize if you find other similar questions, but I am just frustrated. I've looked all over the Internet and StackOverflow for answer and simply didn't find one solution that really worked. However, I did come close.

I already linked my database and created dataview. Then, I was able to execute the report for preview right from the Rave Report Designer (everything looks great). Now, I need to be able do the same thing from my Delphi Program. I need to display or open the preview for my report when a user clicks on a button.

Initially, I only had TRvProject and TRvDataSetConnection on my form but after spending nearly 2 hours trying to implement others suggestion, I have now TRvProject, TRvSystem, TRvRenderView, TRvRenderPrinter and TRvNDRWriter. Needless to say I am confused at this point.

I can call up RvSystem1.Execute; It pops up with a preview window, but there is nothing in it - totally blank.

Although Rave Report Designer View is easy to use, the same can't be said of using it with your Delphi program.

Any input or help will be greatly appreciated.

Was it helpful?

Solution

The most straight forward way would be to use a TRvSystem component with your TRvProject.

  • Make sure you have saved your .rav project file. I tested with a non-data aware report.
  • Create a new Delphi project.
  • Drop a TButton, TRvProject and TRvSystem on your form.
  • In your TRvProject, set the ProjectFile property to point to your .rav project file.
  • Also set the Engine property to point to the TRvSystem component.
  • In your TRvSystem component, under SystemSetups, set ssAllowSetups to False.
  • Make sure the DefaultDest property is set to rdPreview.
  • In the TButton's OnClick event, put the following code:

    RvProject1.Execute;

When you run the application and push the button, you should see the preview of your report. I just tried this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top