Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Relationship between Rows and Records
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Relationship between Rows and Records

 Post Reply Post Reply
Author
Message
Ares View Drop Down
Newbie
Newbie


Joined: 07 May 2009
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ares Quote  Post ReplyReply Direct Link To This Post Topic: Relationship between Rows and Records
    Posted: 28 September 2009 at 6:39am
Hi!

I am just trying out the Report Control and I was not able to figure out the releationship between rows and records.

As I understood:
- Each row has ONE record.
- Each records holds on or more RecordItems representing the cells of each row.
- There is no Add methode for rows. Rows are added by using ReportControl.Records.Add(...)

What is the reason for the seperation of rows and records? Is there an easy and quick way to find the correspondig row object to a record object without searching all rows?

I have used the following procedure to add a row/record. This works fine but both messages show that ReportControl.Rows is still empty. How can that be?

        public void AddItem(Object obj) {
            MessageBox.Show(ReportControl.Rows.Count.ToString()); // --> 0

            ReportRecord newRecord = ReportControl.Records.Add();
            SetRecordData(newRecord, obj);

            MessageBox.Show(mailListReport.Rows.Count.ToString()); // --> 0
        }
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post Posted: 28 September 2009 at 11:36am
As far as I know, the ReportRecord object is just a collection of ReportRecordItems. It should probably be named Items (but too late for that now), so where we have:

Row.Record(n) 'as ReportRecordItem

can be thought of as:

Row.Items(n)


It's further confused by not having a Rows.Add method. As you know you add a Row by adding a Record (which is just a collection of Items). A bit weird I think but again, probably too late to do anything about it now.

You can use the ReportControl.Rows.FindRow(Record) method to get the row for a record. Again, a bit weird. Maybe just having Record.Parent would be better.

I expect you're seeing Rows count at zero because you have not called ReportControl.Populate yet.
ExtremeSuitePro 12.1.1
WinXP SP3
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2009 at 1:04am
you can have rows that don't have records - e.g. group header rows.
Back to Top
Ares View Drop Down
Newbie
Newbie


Joined: 07 May 2009
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ares Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2009 at 4:53am
Does anyone know how ReportControl.Rows.FindRow(Record) works? Is this realy a search (complex when using many, many rows/records) or does it use some kind of index or directory?


Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2009 at 7:32pm

"Finds row corresponded with specified record" - ReportRow* FindRow(IReportRecord* Record)

CXTPReportRow* CXTPReportRows::Find(CXTPReportRecord* pRecord) {

for (int i = 0; i < (int) m_arrRows.GetSize(); i++) {

if (m_arrRows.GetAt(i)->GetRecord() == pRecord) return m_arrRows.GetAt(i); }

return 0; }

"Finds row corresponded with specified record (throughout the tree)"  - ReportRow* FindRowInTree(IReportRecord* Record)

CXTPReportRow* CXTPReportRows::FindInTree(CXTPReportRecord* pRecord) {

for (int i = 0; i < (int) m_arrRows.GetSize(); i++) {

if (m_arrRows.GetAt(i)->GetRecord() == pRecord)  return m_arrRows.GetAt(i);

if (m_arrRows.GetAt(i)->HasChildren()) {

CXTPReportRow* pRow = m_arrRows.GetAt(i)->GetChilds()->FindInTree(pRecord);

if (pRow) return pRow; }

}

return 0; }

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.186 seconds.