Relationship between Rows and Records |
Post Reply |
Author | |
Ares
Newbie Joined: 07 May 2009 Status: Offline Points: 7 |
Post Options
Thanks(0)
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 } |
|
ijwelch
Senior Member Joined: 20 June 2006 Status: Offline Points: 262 |
Post Options
Thanks(0)
|
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 |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
you can have rows that don't have records - e.g. group header rows.
|
|
Ares
Newbie Joined: 07 May 2009 Status: Offline Points: 7 |
Post Options
Thanks(0)
|
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?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
"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; } |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |