Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Report Control CustomDrawReport
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Report Control CustomDrawReport

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


Joined: 01 December 2010
Location: UK
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy121070 Quote  Post ReplyReply Direct Link To This Post Topic: Report Control CustomDrawReport
    Posted: 14 March 2017 at 6:11am
I am in the process of looking at generating a report that looks similar to the CustomDrawReport.exe sample.  I have had a look at the samples and sample source code but can't find anything relating to how you get a report row to display like the sample above.

Does anyone have any example source code of this in use that I can take a look at?

Regards

Andy
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 (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2017 at 8:44am
Hello Andy121070,

Initialization of ReportControl is in CCustomDrawReportDlg::OnInitDialog()
    //  Add sample columns
    //

    m_wndReportCtrl.AddColumn(new CXTPReportColumn(REPORTCOLUMN_NAME, _T("Name"), 150));
    m_wndReportCtrl.AddColumn(new CXTPReportColumn(REPORTCOLUMN_ATTR1, _T("Attribute 1"), 150));
    m_wndReportCtrl.AddColumn(new CXTPReportColumn(REPORTCOLUMN_ATTR2, _T("Attribute 2"), 150));
    m_wndReportCtrl.AddColumn(new CXTPReportColumn(REPORTCOLUMN_ATTR3, _T("Attribute 3"), 150));
    m_wndReportCtrl.GetColumns()->GetAt(REPORTCOLUMN_ATTR3)->SetAlignment(DT_VCENTER);

    //
    //  Add sample records in tree
    //

    CString strName;
    CString strProgress;
    for(int i = 0; i < 10; i++)
    {
        strName.Format(_T("Parameter %d"), i);
        strProgress.Format(_T("Progress %d: (%d%%)"), i, 0);
        m_wndReportCtrl.AddRecord(new CMessageRecord(strName, 4, i, 4, 1 << (i & 3), strProgress, RGB(0, 0, 100), 15, 0, 100, i + 1, 0));
    }

    //
    // define style attributes for the report control.
    //

    m_wndReportCtrl.GetColumns()->Find(REPORTCOLUMN_NAME)->SetTreeColumn(TRUE);

    CXTPCustomDrawReportPaintManager* pPaintManager = new CXTPCustomDrawReportPaintManager(this);

    m_wndReportCtrl.SetPaintManager(pPaintManager);

    //
    // after columns and data have been added call Populate to 
    // populate all of the date for the control.
    //

    m_wndReportCtrl.Populate();


Every row described by class CMessageRecord which contents 4 items CXTPReportRecordItemText, CMessageRecordItemCheckGroup, CMessageRecordItemRadioGroup, CXTPReportRecordItemProgress.

CXTPReportRecordItemText and CXTPReportRecordItemProgress are drawed as default.
CMessageRecordItemCheckGroup and CMessageRecordItemRadioGroup are drawed with method CCustomDrawReportDlg::DrawItem().  You can set breakpoints to see callstack.

Regards,
 Oleksandr Lebed
Back to Top
Andy121070 View Drop Down
Groupie
Groupie


Joined: 01 December 2010
Location: UK
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy121070 Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2017 at 5:05am
Thank you for the response Oleksandr

Should I be able to find the full source code file in any of the CodeJock sample source code?  If so, which one do I need to look at?
Regards

Andy
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 (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2017 at 6:30am
you can open sample project
c:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v17.3.0\Samples\ReportControl\ReportCustomDraw\CustomDrawReport_vc140.sln

and see in Solution Explorer all files of sample.

Source files of ReportControl you can find in c:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v17.3.0\Source\ReportControl\

Better way is to add ToolkitPro project to solution of sample ReportCustomDraw. You can find project of ToolkitPro in c:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v17.3.0\Workspace\ToolkitPro\ToolkitProShared_vc140.vcxproj

Then with using debugging and breakpoints in methods you can explore how ReportControl works.
Back to Top
Andy121070 View Drop Down
Groupie
Groupie


Joined: 01 December 2010
Location: UK
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy121070 Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2017 at 6:39am
Thanks for that.  That would explain why I can't find the sample.  We only have the ActiveX version of the controls.

Regards

Andy
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.172 seconds.