Print Page | Close Window

Report Control

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3453
Printed Date: 09 November 2025 at 7:15pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report Control
Posted By: almatesic
Subject: Report Control
Date 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!




Replies:
Posted By: SuperMario
Date 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. 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net