Hey,
I'm trying to make a report in C++ get information on how many videos have been rented from a database, and put the records into a report. However, my report only puts the first record into there. Does anyone know why it isnt working?
My OnClick code is:
My report layout is:Code:void __fastcall TMainForm::Button8Click(TObject *Sender) { TADOQuery *activityQuery = new TADOQuery (this); if(activityQuery) { activityQuery->Connection = DataModule1->ADOConnection1; activityQuery->SQL->Text = "SELECT * FROM accounts ORDER BY may DESC"; activityQuery->Active = true; if(activityQuery->Active) { ActivityReport->CustomerNameLabel->Caption = activityQuery->FieldByName("contact_name")->AsString; ActivityReport->VideosRentedLabel->Caption = activityQuery->FieldByName("may")->AsString; ActivityReport->Preview(); } } }
Thanks