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

Best Fit

 Post Reply Post Reply
Author
Message
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Topic: Best Fit
    Posted: 31 July 2005 at 4:24pm
I'm having trouble with the Best Fit feature of the Report Control. The best fit function makes the column width a few pixels too narrow. This causes the "..." ellipses to be used when the item is drawn. 

The problem exists in my application, and also in the "ReportSample" sample (use the best fit feature on the "Recieved" column - or any column except the last column).
For Example:


I'm using Toolkit Pro v9.60, with Visual Studio 2003 writing a MFC app, on a XP computer, with the default set of fonts.

BTW --> Typo: the "Recieved" column should be "Received" in the sample

Thanks

Warren
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2005 at 5:09am
Thank you, it is fixed for 9.71, also added Double Click on Risize part to BestFit.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2005 at 7:47am
Thanks for looking into this so quickly! The support for this product is just great.

Thanks for also adding the feature I was about to suggest:
Originally posted by oleg oleg wrote:

...also added Double Click on Risize part to BestFit.

before I even got a chance to suggest it (psychic support ?!?!)

Warren
Back to Top
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2005 at 5:20pm
I'd like to re-open this issue.

The Column-sizing algorithm doesn't seem to take into account the Width of Column Title. This causes the name to get cut off, and the "..." to appear when the Name of the Column is wider than any of the contents.

To duplicate the behaviour (in the 9.80 version of the samples)
Codejock Samples -> Report Sample -> Report Control Menu -> Task List Dialog
and "double-click resize" on the "% Complete" Column.

I'd also like the algorithm to take into account the width of the little sort-direction arrow that shows up too (so sorting the column doesn't cause the name to get cut off either).

Thanks !

Warren

I'm using Toolkit Pro v9.80, with Visual Studio 2003 writing a MFC app, on a XP computer, with the default set of fonts.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 November 2005 at 3:11am

Thakn you, good suggestion,

fixed for 9.81

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Posted: 14 February 2006 at 7:44pm
I'd like to re-open this issue once more (I'm using 9.81 right now). The best-fit still causes the name to get cut off, and the "..." to appear

To duplicate the behaviour (in the 9.81 version of the samples)
Codejock Samples -> Report Sample -> Report Control Menu -> Task List Dialog
1) Click on the "Subject" header, so the sort triangle shows up on the "subject" column.
2) Now "double-click resize" the "% Complete" Column (by double-clicking the right edge of the column)
3) Now click on the "% Complete" header, so the sort arrow shows up on the "% Complete" header.
Result: "% Complete" name is now "% Co..."

From looking at your source, I suggest the following:
in file: "xtpreportcolumn.cpp"
in function: "int CXTPReportColumn::GetBestFitWidth() const"

replace the line:
if (HasSortTriangle())
with the line:
if (IsResizable())

Since the sort triangle may show up after the column has been best-fit sized.

Thanks

Warren
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 February 2006 at 8:01am

Hello,

You can call

wndReport.GetPaintManager()->m_bDrawSortTriangleAlways = FALSE;

so it will acts exactly like in Office

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Posted: 15 February 2006 at 9:22am
Oleg,

Yes, that does get rid of the "..." (which is a definite improvement), but it comes at the expense of not drawing the sort triangle (without which, it is really hard to tell what's going on)

I think the "best-fit" column width (for a sortable column) should include the width of the sort-triangle. Don't you agree?
(at the very least it would be nice for this to be an option)

Sorry, in my suggested code above, I meant to say "IsSortable" by I wrote "IsResizable" when I was typing it in here.(That's got to be a record, I suggest one line of code and it has a bug ) It should read:

replace the line:
if (HasSortTriangle())
with the line:
if (IsSortable())


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.156 seconds.