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

Indent Problem

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


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post Topic: Indent Problem
    Posted: 31 March 2009 at 2:11pm
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2009 at 11:04pm

Do you try to call ShowGroupBy after Populate call? Same for GetGroupOrder()->Add calls?

Also you need to check current version (13.1) - here you can get static app to try: https://forum.codejock.com/uploads/DemoVersion/ReportSampleSatic.rar
Back to Top
securigy View Drop Down
Groupie
Groupie


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2009 at 12:51pm
are you saying the the order of the calls is not correct? if that's the case what should it be? populating the control with data comes way later when I have the data. actually, the problem is not with the ident of the group and subgroup - they are indented fine... the problem is that the data that I gather later and add to a subgroup is not indented... - pls see the file that I uploaded (link is in my original post)
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2009 at 12:54pm
You uploaded file based on old version. Please re-run with current and we can talk later. I propose also call layout adjustment after populate - why don't try it?
 
I also don't know how you add new records as child records? Need code to check. But refresh all to current version first
Back to Top
securigy View Drop Down
Groupie
Groupie


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2009 at 1:51pm
I requested v13.1 and waiting for response. Meanwhile I tried this after adding each record:

if(pMsg)

     this->SendMessage(WM_ADD_RECORD_EX, (WPARAM)pMsg, 0);

SetTreeIndent(10);

AdjustLayout();

RedrawWindow(0, 0, RDW_ALLCHILDREN|RDW_INVALIDATE);

neither of it helps.

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2009 at 2:23pm
run recommended sample. from menu call TreeView Dlg - see how indenting done for subject items - click on expand little button to see. I can give you the code for this dialog
Back to Top
securigy View Drop Down
Groupie
Groupie


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2009 at 2:46pm
the code sample will certainly help.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2009 at 2:50pm
This is a demo to add new child records run-time on mouse r-click on report row

afx_msg void OnReportRClick(NMHDR * pNotifyStruct, LRESULT * result);

ON_NOTIFY(NM_RCLICK, IDC_REPORT, OnReportRClick)

void CTreeViewDlg::OnReportRClick(NMHDR * pNotifyStruct, LRESULT * /*result*/){

XTP_NM_REPORTRECORDITEM* pItemNotify = (XTP_NM_REPORTRECORDITEM*) pNotifyStruct;

if (pItemNotify->pRow)

{

// TRACE(_T("Right click on row %d\n"), pItemNotify->pRow->GetIndex());

COleDateTime odtSent(COleDateTime::GetCurrentTime());

COleDateTime odtCreated(COleDateTime::GetCurrentTime());

COleDateTime odtReceived(COleDateTime::GetCurrentTime());

CString strMessage(" ");

CString strEmpty(" ");

odtSent -= 8;

CMessageRecord* pRec = new CMessageRecord(msgImportanceNormal, TRUE, TRUE,

_T("Somebody"), _T("I Understand!"), odtSent, 24, FALSE, 5.4321,

odtCreated, odtReceived, strEmpty, strEmpty, strMessage,

strEmpty, strEmpty, strEmpty,

strEmpty, strEmpty,

strMessage);

CXTPReportRecord* pNew = pItemNotify->pRow->GetRecord()->GetChilds()->Add(pRec);

if (pNew)

pItemNotify->pRow->SetExpanded(TRUE, TRUE);

m_wndReport.Populate();

}

}

Back to Top
securigy View Drop Down
Groupie
Groupie


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2009 at 4:22pm
here what I discovered: I used AddRecordEx to add records and apparently it does not work correctly.
I switched to AddRrcord + Populate and it works well now.
THank you Mark.
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.