Print Page | Close Window

Resize last column + printing

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=16517
Printed Date: 29 September 2024 at 9:18am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Resize last column + printing
Posted By: markr
Subject: Resize last column + printing
Date Posted: 25 March 2010 at 12:16pm
Hello,

I'm using the following simple function to resize only the last report control column:

void CMyReportView::InitColSizing()
{
    int nColumnsCount = GetReportCtrl().GetColumns()->GetCount(), nColumn;
    for (nColumn = 0; nColumn < nColumnsCount; nColumn++)
    {
        CXTPReportColumn* pColumn = GetReportCtrl().GetColumns()->GetAt(nColumn);
        if (pColumn && pColumn->IsResizable())
            pColumn->SetAutoSize(FALSE);
    }
   
    GetReportCtrl().GetColumns()->GetLastVisibleColumn()->SetAutoSize(TRUE);
}


Unfortunately, once I do this is seems to interfere with printing. Specifically, the last column stretches beyond the normal print border (this effect is also visible in print previews). Here's a screen shot of the problem:



If I don't adjust the column sizing, everything works as expected.

Anyone know how what I might be doing wrong here?





Replies:
Posted By: markr
Date Posted: 02 April 2010 at 9:55am
Anyone else experiencing a similar problem? Seems like a bug to me, unless I'm just missing something.


Posted By: znakeeye
Date Posted: 07 April 2010 at 1:37pm
First of all, what you are trying to do was implemented already. See SetAutoColumnSizing function here:  http://forum.codejock.com/forum_posts.asp?TID=15075&KW=last - http://forum.codejock.com/forum_posts.asp?TID=15075&KW=last
 
However, it never worked properly. So I'm still waiting for a fix, and I also believe I have pinpointed the bug you found:
"If you move your last column to the left, you get strange behavior when resizing."
 
Sure sounds like the same bug.


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: markr
Date Posted: 07 April 2010 at 2:27pm
> First of all, what you are trying to do was implemented already. See SetAutoColumnSizing

I'm aware of this function, but it does not appear to be relevant to the problem I outlined. For example, if I distill my function down to two simple lines:

GetReportCtrl().GetReportHeader()->SetAutoColumnSizing(FALSE);
GetReportCtrl().GetColumns()->GetLastVisibleColumn()->SetAutoSize(TRUE);

It effectively does nothing at this point - no columns are resized (including the last one). it appears to be necessary to use a combination of SetAutoColumnSizing(TRUE), then turn off column sizing for all but last column.

But then when I do this, I have the printing problem that I outlined originally.



Posted By: markr
Date Posted: 07 April 2010 at 2:37pm
BTW, it appears that in the v13.3.1 I can just call:

GetReportCtrl().GetReportHeader()->SetLastColumnExpand(TRUE, TRUE);

Which will implement an algorithm nearly identical to that in my original post.

But again, it still exhibits the printing problem that I outlined.


Posted By: znakeeye
Date Posted: 12 April 2010 at 4:36pm
Sorry, that was the function I meant! And... it's buggy! I do believe the printing issue has to do with the drawing problems that appear when using this function.
 
Try creating a support ticket. Maybe CJ will notice...


-------------
PokerMemento - http://www.pokermemento.com/



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