Results 1 to 5 of 5

Thread: C++ Reports Help

  1. #1
    Senior Member
    Join Date
    Jan 2006
    Location
    Oop North
    Posts
    1,403
    Thanks
    2
    Thanked
    4 times in 4 posts

    C++ Reports Help

    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:

    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();
                    }
            }
    }
    My report layout is:



    Thanks

  2. #2
    Senior Member skuzgib's Avatar
    Join Date
    Oct 2004
    Location
    Bromsgrove, Worcestershire / Durham
    Posts
    1,917
    Thanks
    6
    Thanked
    1 time in 1 post
    Would you not need a for loop from 0 to the number of records -1? ATM it looks like its only doing one record.

    EDIT and then navigate to the next record before going into the next iteration.
    Last edited by skuzgib; 25-05-2006 at 01:29 PM.

  3. #3
    Senior Member
    Join Date
    Jan 2006
    Location
    Oop North
    Posts
    1,403
    Thanks
    2
    Thanked
    4 times in 4 posts
    I tried that, but it was just overwriting the one set of labels that are there, rather than creating new ones.

  4. #4
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts
    yeh thats probably to do with how your usign AcitivityReport. Don't you need to create a new one for each 'row'?
    throw new ArgumentException (String, String, Exception)

  5. #5
    Senior Member
    Join Date
    Jan 2006
    Location
    Oop North
    Posts
    1,403
    Thanks
    2
    Thanked
    4 times in 4 posts
    Quote Originally Posted by TheAnimus
    yeh thats probably to do with how your usign AcitivityReport. Don't you need to create a new one for each 'row'?
    You mean create a new set of labels for each row? The problem is that the amount of records that it returns is dynamic. There is a way to make C++ clone the labels for how many records there are, but I can't remember how you do it. I think it has something to do with the bands though.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Crystal Reports Replacement
    By eldren in forum Software
    Replies: 5
    Last Post: 24-03-2010, 05:34 PM
  2. Orange to start charging for SMS delivery reports!
    By MD in forum Smartphones and Tablets
    Replies: 25
    Last Post: 14-03-2006, 10:46 PM
  3. BBC releases 79 online news reports from archives
    By Bob Crabtree in forum HEXUS News
    Replies: 0
    Last Post: 04-01-2006, 10:28 AM
  4. Replies: 6
    Last Post: 07-03-2005, 07:38 PM
  5. Access Reports - help....
    By Lead_Head in forum Software
    Replies: 5
    Last Post: 22-10-2003, 12:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •