Rave - General
What is the procedure for printing TCharts in Rave?
Printing TCharts with Rave is quite simple. You can do this with a custom connection component by dropping the TRPCustomConnection component down on a form and defining two events: OnGetCols and OnGetRow (See the example code below). After defining the events, run your application , so that the connection can be seen from within Rave, and open the visual designer. Create a new DataView for the custom connection that you have just defined, drop down a metafile component onto the page where you want the TChart to appear and hook up the DataView and DataField properties. You are now ready to print the TChart. (For more information on custom connections, see Tutorial 26 in the manual.)
Delphi Example:
uses RPTChart; procedure TForm1.RPCustomConnection1GetCols( Connection: TRPCustomConnection); begin with Connection do begin // PieChart is the name of the DataField that you will use in Rave WriteField('PieChart', dtGraphic, 30, '', ''); end; { with } end; procedure TForm1.RPCustomConnection1GetRow( Connection: TRPCustomConnection); begin // Chart is the name of the TChart component you are wanting to print WriteChartData(Connection, Chart); end;
C++Builder Example:
#include "RPTChart.hpp" #pragma link "RPTChart" void __fastcall TForm1::RPCustomConnection1GetCols( TRPCustomConnection *Connection) { // PieChart is the name of the DataField that you will use in Rave Connection->WriteField("PieChart", dtGraphic, 30, "", ""); } void __fastcall TForm1::RPCustomConnection1GetRow( TRPCustomConnection *Connection) { // Chart is the name of the TChart component you are wanting to print WriteChartData(Connection, Chart); }