Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Invisible records
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Invisible records

 Post Reply Post Reply
Author
Message
Tex in a Can View Drop Down
Newbie
Newbie


Joined: 02 May 2007
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tex in a Can Quote  Post ReplyReply Direct Link To This Post Topic: Invisible records
    Posted: 02 May 2007 at 5:45pm
I have a combination of record items that will not display the data on the report control, see attached bitmap. The records appear to have been added (the sorts work and there are lines below the records) but the data is invisible. I modified the record sample with these record items and have attached the zipped project? Can anyone help? If I revert to the sample record items the data appears. I am totally confused.
 
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: 07 May 2007 at 8:37am
You need to insert each cell into the record.

your class CalGridRect doesn't call AddItem.

Sample code for a reportRecord

class SampleRecord : public CXTPReportRecord
{
public:
    SampleRecord(CString sData, double dData)
    {
        m_pText = new CXTPReportRecordItemText();
        AddItem(m_pText);
        m_pNumber = new CXTPReportRecordItemNumber()
        AddItem(m_pNumber);
        m_pText->SetValue(sData);
        m_pNumber->SetValue(dData);
    }

    CXTPReportRecordItemText* m_pText;
    CXTPReportRecordItemNumber* m_pNumber;

};


make sure you use pointer members and new them, otherwise when the framework deletes the pointers you pass in, you'll get heap corruption and a flaky app.  It only seems to happen in release builds too, I guess due to differences in new and delete for debug vs release builds.


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.156 seconds.