如何使用 Rave 来打印一个数据库?
比如数据库名字为 a.dbf,其中有一个名为tt的表.我要在 form上和Rave Project中必须增加哪些控件?需要设置这些控件的什么属性?

解决方案 »

  1.   

    以下是打印数据表格的步骤,不难翻译,按着步骤做,应该没问题
    You can use Rave Reports in both VCL and CLX applications to generate reports from databaseand non-database data. The following procedure explains how to add a simple report to an existing database application.1 Open a database application in Delphi.
    2 From the Rave page of the Component palette, add the TRvDataSetConnection component to a form in the application.
    3 In the Object Inspector, set the DataSet property to a dataset component that is already defined in your application.
    4 Use the Rave Visual Designer to design your report and create a report project file (.rav file). Choose Tools|Rave Designer to launch the Rave Visual Designer.
    Choose File|New Data Object to display the Data Connections dialog box.
    In the Data Object Type list, select Direct Data View and click Next.
    In the Active Data Connections list, select RVDataSetConnection1 and click Finish.
    In the Project Tree on the left side of the Rave Visual Designer window, expand the Data View Dictionary node, then expand the newly created DataView1 node. Your application data fields are displayed under the DataView1 node. Choose Tools|Report Wizards|Simple Table to display the Simple Table wizard.
    Select DataView1 and click Next. 
    Select two or three fields that you want to display in the report and click Next.
    Follow the prompts on the subsequent wizard pages to set the order of the fields, margins, heading text, and fonts to be used in the report. 
    On the final wizard page, click Generate to complete the wizard and display the report in the Page Designer.Choose File|Save as to display the Save As dialog box. Navigate to the directory in which your Delphi application is located and save the Rave project file as MyRave.rav. 
    Minimize the Rave Visual Designer window and return to Delphi.5 From the Rave page of the Component palette, add the Rave project component, TRvProject, to the form. 
    6 In the Object Inspector, set the ProjectFile property to the report project file (MyRave.rav) that you created in step j. 
    7 From the Standard page of the Component palette, add the TButton component.
    8 In the Object Inspector, click the Events tab and double-click the OnClick event.
    9 Write an event handler that uses the ExecuteReport method to execute the Rave project component. 10 Press F9 to run the application.
    11 Click the button that you added in step 7.
    12 The Output Options dialog box is displayed. Click OK to display the report.