Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Problem with markup and column width
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with markup and column width

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

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Problem with markup and column width
    Posted: 16 September 2009 at 4:33pm
Hi;

I'm using markup to draw graphics combined with text in a report column. So far so good, but when the column width is smaller than the text length, no ellipsis is drawn at the end.
How can I handle this (see picture)?


Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2009 at 5:05pm
Try using the TextTrimming='CharacterEllipsis' attribute for the TextBlock.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2009 at 5:56pm
Originally posted by jpbro jpbro wrote:

Try using the TextTrimming='CharacterEllipsis' attribute for the TextBlock.


Thanks!

After changing it to <TextBlock Width='100' TextTrimming='CharacterEllipsis'>xxx</TextBlock> it works.
BTW "TextTrimming" isn't listed in Markup Readme.txt. So I didn't know this.
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2009 at 5:59pm
Glad to help! The documentation is certainly lacking in some areas. I usually just search Google for the element that I am working with and see what MS XAML can handle...sometimes it has (fortunately) been implemented in CJ XAML as well (as was the case with TextTrimming).
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2009 at 7:05pm
Hi;

I have a further question about XAML TextTrimming...
I'm using this XAML-String
                    strItem.Replace(_T("&"), _T("&amp;"));
                    strItem.Replace(_T("<"), _T("&lt;"));
                    strItem.Replace(_T(">"), _T("&gt;"));
                    pItemMetrics->strText.Format(_T("<StackPanel Margin='0, 0, 0, 0' HorizontalAlignment='Left' Orientation='Horizontal'>")
                                                          _T("<Canvas HorizontalAlignment='Left' Width='15' Height='10'>")
                                                          _T("<Ellipse Canvas.Top='-2' Fill='%s' Width='10' Height='10' StrokeThickness='1' Stroke='#aa335588'/>")
                                                          _T("</Canvas>")
                                                          _T("<TextBlock Width='%ld', Height='%ld' MaxWidth='32000' TextTrimming='CharacterEllipsis'>%s")
                                                          _T("</TextBlock>")
                                                          _T("</StackPanel>"
), hexString, pDrawArgs->rcItem.Width()-17, pDrawArgs->rcItem.Height(), strItem);
                    if (pDrawArgs->pItem->GetMarkupUIElement()==0 || pDrawArgs->pItem->GetCaption(0)!=pItemMetrics->strText) {
                        pDrawArgs->pItem->SetCaption(pItemMetrics->strText);
                    }
in my own CXTPReportRecord derived MyRecord::GetItemMetrics() to format the content as shown in my previous posts above. I see the ellipsis at the end of the text if the column width is smaller than the whole content but because
I set the width of the text block explicitely in XAML, the report control measures the required with for showing the whole content wrong when double clicking onto the corresponding column divider. This results in a 'fixed' column width. Which is not what I want...
How can I solve this? Any ideas?
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2009 at 7:34pm
Hi;

I found a strange bug in XTPReportControl version 13.2:
When resizing columns that are only partly visible (left or right border is outside the report control borders) the opposite column divider is drawn outside the report control bounding rectangle.
Additional the dragging column divider can be moved and dropped outside the bounding rectangle too!
I've never seen such 'feature' in any other control...

To show the problem I've uploaded a small MP4 video...

uploads/20091029_193337_ReportCtrl.rar
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2009 at 4:16am
Hi;
I changed the way I handle the markup part to use the new GetPaintManager()->m_bForceDynamicMarkupForCell=TRUE property introduced in version 13.2 - BTW I suggest to hide member variables and only provide Get/Set functions - but this results in a new problem.
Now when double clicking onto the right column divider to size the column to best fit the content, the column is resized to about 1000 px.

All I did was setting above flag and removing the last three lines of code I inserted into my last post.

Perhaps this is a BUG in report control!
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2009 at 5:10pm
No ideas?
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
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.