Resize last column + printing |
Post Reply |
Author | |
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
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? |
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
Anyone else experiencing a similar problem? Seems like a bug to me, unless I'm just missing something.
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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
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/
|
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
> 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. |
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
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. |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |