Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - BUG: Wrong position for group row summaries
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

BUG: Wrong position for group row summaries

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: BUG: Wrong position for group row summaries
    Posted: 11 October 2022 at 12:16pm
Hi!

I use this code to put in a summary in several levels of group rows for a column in a report control.
To create the summary I use this code:
for (int i = 0; i < TheRows->GetCount(); i++) {
    CXTPReportRow* TheRow = TheRows->GetAt(i);

    if (TheRow->IsGroupRow()) {
      CXTPReportGroupRow* GroupRow = reinterpret_cast<CXTPReportGroupRow*>(TheRow);

      double Value=0.0;
      
      Value=DoCalculateChildren(TransactionType, GroupRow->GetChilds(), 0.0);
     ...

      NumberFormatter_.str(L"");
      NumberFormatter_ << std::dec << std::fixed << std::setprecision(Precision) << round(Value, Precision);

      auto GroupCaption=fmt::format(L"{} [{}] {} {}", GroupRow->GetCaption().GetString(), Column, NumberFormatter_.str(), Unit);

      GroupRow->SetCaption(GroupCaption.c_str());
      GroupRow->SetFormula(L"x");
    }
  }

Calculation of the summaries for each level and formatting for the group captions including the summary column is correct, but the the higher the level of the group row the more is the caption of the summary column shifted to the right. In level 0 (first group row) the placement is ok!
Here's a screenshot to show the problem:


The problem can be reproduced in v19.1 up to including v20.3! I didn't test older versions.

How can I fix this annoying displacement?

TIA
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
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.143 seconds.