Print Page | Close Window

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=23591
Printed Date: 26 April 2024 at 4:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Auto Numbering
Posted By: umair
Subject: Auto Numbering
Date Posted: 01 March 2018 at 1:41am
Hello,
How to set Auto Numbering Column to not to sort when sorting other column in Report Control?
Please Help.



Replies:
Posted By: olebed
Date Posted: 06 March 2018 at 1:00am
Hello,

You need to set CXTPReportPaintManager::m_bRecOrRowNum  to FALSE.
    wndReport.GetPaintManager()->m_bRecOrRowNum = FALSE;

Note that you should do this every time on change theme (set new PaintManager).

Regards,
 Oleksandr Lebed


Posted By: umair
Date Posted: 06 March 2018 at 1:32am
Its working! Thank You Oleksandr Lebed

Two more think i want to ask.
1) How to start Auto Numbering from 1 (not from zero)?
2)When I Print the report control, it print all data except Auto Numbering column which printing as empty?
Please help


Posted By: olebed
Date Posted: 06 March 2018 at 2:40am
I have tried with GridSample  and it draws AutoNumbering column as expected.

It is not easy to guess what exactly interferes with printing. I can advice to open PrintPreview in your application and then set breakpoint in method CXTPReportRow::Draw()   in line ~417 
CXTPReportColumn *pColumn = m_pControl->GetColumns()->GetAt(nColumn);

Then in PrintPreview press button Print.  First column {#0} on breakpoint should be your AutoNumbering column. Execution should go to line ~530  with DrawRowNumber()
pPaintManager->DrawRowNumber(pDC, rcItem, this);
so you can see what happens in your application, what exactly condition don't allow to print numbers. If DrawRowNumber called then may be problem in method DrawRowNumber(). May be text color is white on white background. Try to change colors
//CXTPFontDC font(pDC, GetTextFont(), GetXtremeColor(COLOR_HIGHLIGHT));
CXTPFontDC font(pDC, GetTextFont(), RGB(255,0,0));



Posted By: umair
Date Posted: 06 March 2018 at 4:00am
Thank You Oleksandr Lebed.
I resolved the issue as:
if (pColumn->IsAutoNumbering())
{
     pPaintManager->DrawRowNumber(pDC, rcItem, pRow);
}
else
{
     int nItemTextWidth = pItem->Draw(&drawArgs);
}
And also resolved the first issue as:

GetPaintManager()->m_iRecOrRowStart = 1;



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