Print Page | Close Window

ReportControl auto-numbering

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=15535
Printed Date: 29 September 2024 at 1:29pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ReportControl auto-numbering
Posted By: unknow
Subject: ReportControl auto-numbering
Date Posted: 02 November 2009 at 5:09pm

Hi. I would like to include an automatic line numbering column as seen in the ReportPaneView sample;

I understand it uses the "AssignIconViewPropNumAndIconNum" method but I can't get it working, the "rec#" column includes a copy of the 1st column which is text;
 
An additional question: how to force the current focused row to switch to edit mode for the 1st column (bAllowEdit is set and works with mouse).
 
Thankx !!
 



Replies:
Posted By: mdoubson
Date Posted: 02 November 2009 at 5:58pm

void CReportPaneViewView::OnInitialUpdate()  {

CXTPReportView::OnInitialUpdate();

CString columnStr;

for (int i = 0; i < COL_NUMBER; i++) { columnStr.Format("Column %d",i);

CXTPReportColumn* pCol = GetReportCtrl().AddColumn(new CXTPReportColumn(i, columnStr, 60, FALSE,XTP_REPORT_NOICON,TRUE));

pCol->EnableResize(TRUE); }

for (int j = 0; j < ROW_NUMBER; j++)  GetReportCtrl().AddRecord(new CReportViewRecord(j));

GetReportCtrl().Populate();

GetReportCtrl().GetReportHeader()->SetAutoColumnSizing(FALSE);

GetReportCtrl().GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007);

GetReportCtrl().GetPaintManager()->SetDrawGridForEmptySpace(TRUE);

GetReportCtrl().GetPaintManager()->SetGridStyle(0, xtpReportGridSolid);

GetReportCtrl().GetPaintManager()->SetGridStyle(1, xtpReportGridSolid);

GetReportCtrl().GetPaintManager()->SetHeaderRowsDividerStyle(xtpReportFixedRowsDividerBold);

GetReportCtrl().GetPaintManager()->SetFooterRowsDividerStyle(xtpReportFixedRowsDividerBold);

GetReportCtrl().GetPaintManager()->m_clrHeaderRowsDivider = RGB(255,0,0);

GetReportCtrl().GetPaintManager()->m_clrFooterRowsDivider = RGB(0,0,255);

GetReportCtrl().AssignIconViewPropNumAndIconNum(-1, -1, TRUE, 20);

GetReportCtrl().GetPaintManager()->SetLastColumnWidthWYSIWYG(TRUE);

GetReportCtrl().GetPaintManager()->SetColumnWidthWYSIWYG(TRUE);

m_pPrintOptions->GetPageHeader()->m_strFormatString = "Header text: &p from &P";

m_pPrintOptions->GetPageFooter()->m_strFormatString = "Footer text: &D";

GetReportCtrl().m_bForcePagination = TRUE;

GetReportCtrl().AllowEdit(TRUE);

GetReportCtrl().EnableDragDrop(_T("ReportPaneView"), xtpReportAllowDragMove | xtpReportAllowDragCopy | xtpReportAllowDrop);

GetReportCtrl().GetPaintManager()->SetHeaderRowsDividerStyle(xtpReportFixedRowsDividerBold);

GetReportCtrl().GetPaintManager()->SetFooterRowsDividerStyle(xtpReportFixedRowsDividerBold);

GetReportCtrl().GetPaintManager()->SetDrawGridForEmptySpace(TRUE);

GetReportCtrl().GetPaintManager()->SetFreezeColsDividerStyle(xtpReportFreezeColsDividerThin | xtpReportFreezeColsDividerShowAlways);

GetReportCtrl().GetColumns()->GetFirstVisibleColumn()->SetAutoSize(FALSE);

GetReportCtrl().m_bDesktopTrackerMode = FALSE;

GetReportCtrl().RedrawControl();

}



-------------
Mark Doubson, Ph.D.


Posted By: unknow
Date Posted: 04 November 2009 at 4:59pm
Thanks Mark, but I've already taken some portions of the code you posted;
 
My ReportControl is already implemented & working and I just want to add the 1st column with numbers.
 
As I wrote, the "rec#" column is present but I don't understand how to fill the value, instead of having numbers, I get a copy of the first column which contains text !!????
 
In this code you posted, which lines make the thing work ?
 
Thankx!


Posted By: mdoubson
Date Posted: 04 November 2009 at 5:12pm
This is totally system-filled column - it show current row (or rec) index. I attach my code to show you the order of initialization steps. No need any other code to use number column but you can switch GetReportCtrl().GetPaintManager()->m_bRecOrRowNum = TRUE or FALSE

-------------
Mark Doubson, Ph.D.



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