Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print current record in QuickReport

Status
Not open for further replies.

beayn

Programmer
Dec 5, 2010
3
CA
I've created a database and form to enter the data. I also have QuickReport set up to print all the records when needed, however I can't seem to figure out how to make it print only the current record.

For example, when the user is entering the data, I would like to have a Print button available for them to hit. It would print only the current record using the QuickRep format I have set up on the same form.

I probably could have figured this out 10 years ago but this is the first time I've worked in Borland C++ Builder in at least 10 years.

 
It's been about 10 years since I've used QuickReports. I'll look at some old code and see how I did it.


James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
That would be great if you could find out how you did it. I'm sure it's relatively easy, but I've been tinkering with it for far too long without success.

 
I can't seem to figure out how to make it print only the current record

Can you set the filter of your data access component to only make available the desirable (current) record? OR, can you do a quick "SELECT" query to pull into memory only the one record you want and print out just that one record?

I know absolutely nothing about QuickReport, but I am familiar with RaveReports and I know RaveReports requires a pointer to a TDataSource, which, in turn, requires a TDataSet (output of a query or an actual table of data). If QuickReport also requires a TDataSource, you can query the data in code and then create a TDataSource in code to output to QuickReport.

Steve.
 
Smays was pretty close if not dead on. I have to dig through my archive CDs to find the old programs using QR. It looks like I set a filter on my datasets before calling the reports up. And I was right. The last time I used these programs was 2000.

James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Hey thanks for the information. I had my mind set on finding record selection within quickrep and not the data source.

I solved the problem with this code:

Table->Filter = "Carrier_Confirm='" + Form1->Carrier_Confirm->Caption + "'";
Table->Filtered = true;
Form1->QuickRep1->Preview();
Table->Filter = "";
Table->Filtered = false;

Where Carrier_Confirm is the record number for this particular app.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top