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

Report Control

 Post Reply Post Reply
Author
Message
almatesic View Drop Down
Newbie
Newbie
Avatar

Joined: 25 November 2005
Location: United States
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote almatesic Quote  Post ReplyReply Direct Link To This Post Topic: Report Control
    Posted: 28 December 2005 at 9:13am

I am trying to add my own data to the columns I have created. I am using the following snippet

// add new record to the record list

CXTPReportRecords* pList = new CXTPReportRecords();

pList->Add(new CXTPReportRecord(0, _T("Albino"), NULL, NULL, NULL, _T("NJ"), _T("07650")));

and it is telling me that CXTPReportRecord does not support 7 arguments. Don't know what I am doing wrong here. Below is the code where I added the above lines.

int CContactViewList::OnCreate(LPCREATESTRUCT lpCreateStruct)

{

if (CXTPReportView::OnCreate(lpCreateStruct) == -1)

return -1;

CXTPReportControl& wndReport = GetReportCtrl();

wndReport.GetReportHeader()->AllowColumnRemove(FALSE);

wndReport.AddColumn(new CXTPReportColumn(0, _T("Name"), 25));

wndReport.AddColumn(new CXTPReportColumn(1, _T("Phone"), 10));

wndReport.AddColumn(new CXTPReportColumn(2, _T("Company"), 25));

wndReport.AddColumn(new CXTPReportColumn(3, _T("Adress"), 15));

wndReport.AddColumn(new CXTPReportColumn(4, _T("City"), 5));

wndReport.AddColumn(new CXTPReportColumn(5, _T("State"), 5));

wndReport.AddColumn(new CXTPReportColumn(6, _T("Zip"), 8));

// add new record to the record list

CXTPReportRecords* pList = new CXTPReportRecords();

pList->Add(new CXTPReportRecord(0, _T("Albino"), NULL, NULL, NULL, _T("NJ"), _T("07650")));

wndReport.SetVirtualMode(new CVirtualRecord(), 50);

wndReport.Populate();

return 0;

}

Thanks a million!

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

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 28 December 2005 at 1:33pm
That is beacuse CXPTReportRecords::Add does not accept 7 arguments:

CXTPReportRecord* Add(CXTPReportRecord* pRecord)

You need:
pList->Add(new CXTPReportRecord());

I suggest looking over the Virtal List sample more closely. 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.

This page was generated in 0.109 seconds.