how to set a variable

I'm a new user of FastReports.

I have a C++ application that accesses an ODBC database. I have created a Report in the FastReport Designer.

I am using the FastReport ActiveX object in the C++ application. I have been able to view a Report successfully in the C++ App
but it is displaying all the data in the database tables.

I need to be able to limit the data that is displayed by passing or setting a variable from the C++ app for the Report.

Checking the FastReport documentation I found the SetVariable() function.

How do I set a variable from the C++ application so that only data for a particular TableID in the main table in the database is displayed.

In this application it saves data for different types of Trucks. I want to be able to view data in the various tables in the database for only one Truck that is identified by its TruckID

Can this be done using the SetVariable() option in FastReports ?

Thanks for any help.............

Patrick

Comments

  • edited 5:29PM
    I don't use ADO but I hope that this still applies.

    Use query components to only extract the data you want and then report on that.

    Even if you could restrict the data from within FR what are you going to do if someone asks for a report with a different sort order or grouping?

    Queries are by far the most flexible way to extract and deal with data for reporting. Joining tables, filtering and sorting are all very easy to do.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.