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

Auto Numbering

 Post Reply Post Reply
Author
Message
umair View Drop Down
Groupie
Groupie


Joined: 30 November 2017
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote umair Quote  Post ReplyReply Direct Link To This Post Topic: Auto Numbering
    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.
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (1) Thanks(1)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
umair View Drop Down
Groupie
Groupie


Joined: 30 November 2017
Status: Offline
Points: 20
Post Options Post Options   Thanks (1) Thanks(1)   Quote umair Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (1) Thanks(1)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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));

Back to Top
umair View Drop Down
Groupie
Groupie


Joined: 30 November 2017
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote umair Quote  Post ReplyReply Direct Link To This Post 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;
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.141 seconds.