Print Page | Close Window

Best Fit

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=2665
Printed Date: 27 November 2024 at 12:53am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Best Fit
Posted By: Warren
Subject: Best Fit
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: Warren
Date 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


Posted By: Warren
Date 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.


Posted By: Oleg
Date Posted: 11 November 2005 at 3:11am

Thakn you, good suggestion,

fixed for 9.81



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Warren
Date 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


Posted By: Oleg
Date 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


Posted By: Warren
Date 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())





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net