Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [BUG] Metrics for Report Item doesn't show markup
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[BUG] Metrics for Report Item doesn't show markup

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

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Topic: [BUG] Metrics for Report Item doesn't show markup
    Posted: 06 March 2009 at 10:35am
Hi,
 
Topic description says it all
 
I don't understand... In V12.1 this worked (and I didn't use it)  and now I want to use markup in ReportItems (yes just this once) and now it doesn't work. I thought this was an OK version but it isn't.
 
In V12.1 this works OK:
 

Metrics.Text = "<TextBlock>" & Item.Value & "<Bold Foreground='Red'>[Changed]</Bold></TextBlock>"

 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2009 at 10:02pm
I checked our VB Report Sample and this code properly works -
        'Execute this code to apply predefined formatting.  To turn on automatic formatting, select it from the menu
        If (mnuAutomaticFormating.Checked) Then
           
            'Replace the backgroung color of every other row
            If ((Row.Index Mod 2 = 0) And (Row.GroupRow = False)) Then
                'This will dynamically change the BackColor of the ReportRecordItem, this value
                'is not saved in the Item.Backcolor property.  Once mnuAutomaticFormating.Checked is false,
                'the original backcolor is restored because this code is not executed
                Metrics.BackColor = RGB(245, 245, 245)
            End If
           
            'Change the text color of items that have the word "Undeliverable" in them
            If (Item.Index = COLUMN_SUBJECT) Then
                If (InStr(1, Item.Value, "Undeliverable", vbTextCompare)) Then
                    'This will dynamically change the text color of the ReportRecordItem, this value
                    'is not saved in the Item.ForeColor property.  Once mnuAutomaticFormating.Checked is false,
                    'the original text color is restored because this code is not executed
                    Metrics.ForeColor = vbRed
                End If
            End If
           
            'Apply fntStrike to the text of all items in a record that have a group caption of "Date: This Year"
            If (Row.Record(10).GroupCaption = "Date: This Year" And Item.Index <> -1) Then
                'This will dynamically change the font of the ReportRecordItem, this value
                'is not saved in the wndReportControl.PaintManager.TextFont property.  Once mnuAutomaticFormating.Checked is false,
                'the original font is restored because this code is not executed
                Metrics.Font.Strikethrough = True
            End If
           
        End If
This is not markup but this is custom draw support.
I don't remember markup sample except group row-related
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2009 at 3:33am
Hi Mark,
 
I didn't say there was something wrong with metrics, ONLY MARKUP !!!
Just add the line of code in DrawBeforeRow event in version:
 
  1. V12.1.0 > Works OK
  2. V13.0.0 > grrrr.....
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2009 at 12:37pm
You not right - it works, e.g.

CString cstrMarkupShortSample(_T("<StackPanel VerticalAlignment='Top' HorizontalAlignment='Center'><TextBlock><Bold>Subject:</Bold> </Italic> <Run Foreground='Red'>2009</Run> Released!</TextBlock></StackPanel>")); 

if (GetReportCtrl().GetMarkupContext()) {

GetReportCtrl().GetColumns()->GetAt(COLUMN_SUBJECT)->SetCaption(cstrMarkupShortSample);

GetReportCtrl().GetRecords()->GetAt(9)->GetItem(COLUMN_SUBJECT)->SetCaption(cstrMarkupShortSample);

GetReportCtrl().GetRecords()->GetAt(9)->GetItemPreview()->SetCaption(cstrMarkupLongSample);

GetReportCtrl().RedrawControl(); }

 
 check item with text SuitPro 2009 - year colored by markup!
 
 
Port piece on VB :
 
Private Sub wndReportControl_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
 
    Dim a As String
    a = "<StackPanel VerticalAlignment='Top' HorizontalAlignment='Center'><TextBlock><Bold>Subject:</Bold> <Italic>SuitePro</Italic> <Run Foreground='Red'>2009</Run> Released!</TextBlock></StackPanel>"
     If Item.Index = 1 Then 
             Item.Caption = a
             wndReportControl.PaintManager.RefreshMetrics
     End If
End Sub
 
 
 
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2009 at 2:28pm
Hi,
 
C'mon Mark, Metrics.Text should accept markup string and not the way you are doing this
 
Now here is test project and this is how it should work and not in a way you explained in previous reply.
 
 
This is build with V12.1.0 OCX
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2009 at 5:34pm
Sorry you always know how it SHOULD work and ignore when I show you HOW TO USE the feature. Wrong (obsolete) documention is not a reason of reporting bug but reason asking to fix the documentation
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2009 at 4:07am
Originally posted by mdoubson mdoubson wrote:

Sorry you always know how it SHOULD work and ignore when I show you HOW TO USE the feature. Wrong (obsolete) documention is not a reason of reporting bug but reason asking to fix the documentation
 
Hi Mark,
 
Did you pay attention Mark? The test project is NOT about showing you how it should work, only how it worked in previous version.
 
This has nothing to do with documentation. I (almost) never read that, only when having trouble with some things... Developers have built entire applications with V12.1 using Metrics.Text because it was implemented like that. They will be happy when upgrading to a newer version..... NOT !!! You can not change an implementation just for you own needs, NEVER !!!!.
 
And now you tell me I don't use it properly  I don't have to change GroupCaption of grouped row (BECAUSE IT WAS IMPLEMENTED LIKE THIS !!!!!) So Metrics.Text does support markup as implemented: 
 
  • Metrics.Text = "<TextBlock>" & rptGrouprow.GroupCaption & " " & "<Bold Foreground='Red'>" & "(" & rptGrouprow.Childs.Count & ")" & "</Bold></TextBlock>"
 
 
So this isn't a bug?
 
Thanks for nothing
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2009 at 10:20pm
VirtualListEdit sample with markup-sample in

void CVirtualRecord::GetItemMetrics(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics){

......

case 5:

{

CString sMarkup;

sMarkup.Format(("<TextBlock><Bold Foreground='Red'>%s</Bold></TextBlock>"), m_pSet->m_Department);

pItemMetrics->strText = sMarkup;

break;

}

......
 
 
 
 
Back to Top
xiote View Drop Down
Newbie
Newbie


Joined: 12 March 2009
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote xiote Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2009 at 10:50pm
it dosn't work Metrics.Text markup in V13(ActiveX)
 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2009 at 12:45pm

void CXTPReportRecordItem::OnDrawCaption(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pMetrics){

ASSERT(pDrawArgs->pItem == this);

//THIS CONDITION - IsVirtualMode() [Rev 7687 Oct 2008] PREVENTS MARKUP in Non-Virtual mode

//if (pDrawArgs->pControl->IsVirtualMode() && pDrawArgs->pControl->GetMarkupContext())

if (pDrawArgs->pControl->GetMarkupContext())

..................................................................
FIXED NOW = be in 13.1
this sample code properly run under recompiled OCX
Private Sub wndReportControl_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
    Metrics.Text = "<TextBlock><Bold>Subject:</Bold> <Italic>SuitePro</Italic> <Run Foreground='Red'>2009</Run> Released!</TextBlock>"
End Sub
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2009 at 2:02pm
Hi Mark,
 
I'm glad you saw the  
 
This is how it should work, if you want to do some magic stuff in BeforeDrawRow event, you shouldn't have to change caption of ReportItem, just leave original value as is and change Metrics.Text if you want to...
 
Thank you
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2009 at 5:14pm
VB Sample run
    For i = 0 To 10
        Set XtremeColumn = ReportControl.Columns.Add(i, "Column " & i, i * 50 + 10, True)
            XtremeColumn.Caption = "<TextBlock>Click <Bold Foreground='Red'>(Me)</Bold></TextBlock>"
    Next i
   
    ReportControl.EnableMarkup = True
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 10:42am
Hi Mark,
 
I know that, if you assign value to Column.Caption, it will work otherwise it doesn't. This has been always like this. (If you would add column and assign value it doesn't show markup). I have no problem with that 
 
But I'm glad you replied on this post. I had to try again because you said you fixed Metrics.Text (with Markup) in BeforeDrawRow event. A while ago I posted a bug regarding Markup when a column is dropped into Groupbox. The "button" in GroupBox shows Markup, but the "button" width is to small :(
 
 
To reproduce:
 
  • Size a column (with Markup) to: let's say 20 pixels (to be sure )
  • Drag column to GroupBox (Image 2)
  • Drag column without Markup (Image 3) There's no problem with this, it resizes OK
Output:
 
 
Thanks
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 11:00am
Could not reproduce - repeat all your steps. If column wide is small - we can't see all markuped text in column but if you drag this column to group box - you see it totally with even extra empty pixels on right side
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 1:10pm
Hi Mark,
 
See post https://forum.codejock.com/forum_posts.asp?TID=12601 for a test project. It was a sticky post but no one replied and after a while I let the post slide down the forum. But now you can actually do something about it
 
Thanks
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 1:22pm
It was old-version embeded project. Please update it to the way I can load it with current version.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 1:45pm
Hi,
 
I uploaded new version in that post.
 
Thanks
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 2:18pm
Thanks. Now I see the problem with small column to drag. Will try to fix
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 4:09pm
So the problem is here:
this is a rectangle used to group item draw:

CRect rcItem(x, y, x + pColumn->GetCaptionWidth(pDC) + 50, y + nHeaderHeight - 3);

and function to GetCaptionWidth is here:

int CXTPReportColumn::GetCaptionWidth(CDC* pDC) {

if (m_pMarkupUIElement) {

CSize szText = XTPMarkupMeasureElement(m_pMarkupUIElement, m_rcColumn.Width(), INT_MAX);

return szText.cx;

}

return pDC->GetTextExtent(m_strName).cx;

}

so if XTPMarkupMeasureElement not properly calculated (and this is not a Report Control code but other component code) - we will have cutted text as we already see.

here CString m_strName; // Column name.

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 6:29pm
 
You test case working fine - get this update with fix for MarkUp done on Report Control level - check other cases please
 
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2009 at 2:16pm
Hi Mark,
 
It looks great  I don't see any problems
 
Thanks a lot
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2009 at 2:48pm
Good. Could you please play with this VB exe:
 
 
Just test reaction on resizing
(btw - there is no modifications in ActiveX - just better initial settings in project)
 
Thanks for testing
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2009 at 1:19am
Hi Mark,
 
I don't know what to look for but the only thing I see is that horizontal scrollbar becomes visible when last column isn't visible anymore (during sizing of form) And sometimes (I saw this about three times) when clicking on scrollbar, the scrollbar becomes invisible but I noticed that RC is 1 pixel wider when this happens...
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2009 at 11:09am
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2009 at 1:31pm
Hi Mark,
 
It looks OK to me, resizing goes well with both RC's and scrollbars are visible when needed.
 
Good job
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2009 at 2:08pm
Hi Mark,

I've just tested this build as well, and everything looks perfect! Thanks a lot for all of your hard work on this issue.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2010 at 11:06am
Sorry to drag up an old post, but I have a question about Metrics.Text and some behaviour that I find strange (and some behaviour that I require).

First, I want:

1) To be able to sort a report control column by a value that is different from what is displayed (easy).
2) The cell display should be automatically formatted with markup (easy)
3) The user to be able to edit a cell without any markup text appearing (apparently difficult, but maybe I am missing something).

I thought that in order to accomplish this, I would:

1) Set the Value property of a ReportRecordItem to the sortable value (for example, "2010-10-10T00:00:00Z")
2) Set the Caption property to the value that the user will edit (for example, "October 10, 2010"), 3) In the BeforeDrawRow event, set the Metrics.Text property to my markup formatted string (for example "<TextBlock><Span Backcolor='Yellow'>October</Span> 10, 2010</TextBlock>" (as long as the PaintManger.ForceDynamicMarkupForCell property was True).

This works in terms of sorting and displaying marked up values, but when the user tries to edit a cell, this is the result:



Why does the edit cell text appear with the markup tags if I only set the Metrics.Text property in the BeforeDrawRow event? My impression was that the Metrics object was for dynamic display purposes only, and the Caption property would be used for the edit cell text (or anywhere the Metrics.Text property wasn't set).

So my questions are:
1) Is this a bug?
2) If no to #1, is there a way to accomplish what I would like to do with the current ReportControl state?
3) If no to #2, can we have a way to accomplish this for the next version?

Thanks for any insights and help.


Also, here's a test project if required:

uploads/2676/RcEditMarkup.zip


Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2010 at 12:14pm
Originally posted by jpbro jpbro wrote:

Sorry to drag up an old post, but I have a question about Metrics.Text and some behaviour that I find strange (and some behaviour that I require).

Why does the edit cell text appear with the markup tags if I only set the Metrics.Text property in the BeforeDrawRow event? My impression was that the Metrics object was for dynamic display purposes only, and the Caption property would be used for the edit cell text (or anywhere the Metrics.Text property wasn't set).

So my questions are:
1) Is this a bug?
2) If no to #1, is there a way to accomplish what I would like to do with the current ReportControl state?
3) If no to #2, can we have a way to accomplish this for the next version?

Thanks for any insights and help.


Also, here's a test project if required:

uploads/2676/RcEditMarkup.zip


 
Hi Jason,
 
  1. O.... my....God....  Someone fu**ed up the ReportControl. You are right, Metrics object is designed for dynamic display purposes ONLY.
  2. What kind of sorting do you mean. RC supports sorting DATE & TIME values, numbers (int,long etc etc) and ordinary strings of course...
  3. Depending what you mean by 2. LOL
 
   
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2010 at 6:30pm
Hi Aaron, thanks for the reply - so I'm not crazy then ;)

By #2, I meant that I generally want to accomplish the following:

3 "values" associated with a ReportControlItem:

1) A hidden value used for sorting purposes (i.e. the Value property)
2) A value used for editing and default display purposes (i.e. the Caption property)
3) A value used for dynamic formatting (display purposes only) that over-rides the Caption value when present (the Metrics.Text property).

The user should never see raw markup, so they should see the Caption property value when EditMode = True and see the Metrics.Text value (as rendered Markup if it's a markup string) when EditMode=False (or if Metrics.Text isn't set to anything in the BeforeDrawRow event, then just default the cell text to the Item.Caption value).

I used dates as just a simple example for demo, but what I really need a separate value for is a custom sort string that I create that allows me to sort alpha-numeric values smartly.

For example, if the user types this in 5 different cells:

A10
A3
A200
A1
A2

Normal sorting rules would display in this order:

A1
A10
A2
A200
A3

I have a routine which pads out internal numbers to something like this (again, example):

A00010
A00003
A00200
A00001
A00002

So that when you sort the list appears as:

A1
A2
A3
A10
A200

Of course, I don't want the user to see the padded out numbers, so I use the Value property for them. The user can type codes like A1, A2, etc... and they will now be sorted "correctly" but look just as they type them in the cell display and edit box. Lastly, different leading alpha characters (A, B, C, etc...) can have a different colour associated with them, so I want to use the Metrics.Text property to display the cell in a custom format.

I'm not sure why the edit window for a cell is defaulting to the Metrics.Text value - I've even tried changing the Metrics.Text property to Item.Caption in the RequestEdit and BeforeDrawRow events, but I haven't had any luck getting the edit window text to appear without markup tags...

I'll keep experimenting and also open a ticket.

Thanks for your help, Merry Christmas!
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2010 at 6:57pm
Looks like you can use SendMessage on the InplaceEditHwnd with WM_SETTEXT to get the caption to appear without markup tags. I don't think we should have to do this though.

Here's a demo:

uploads/2676/RcEditMarkup2.zip
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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: 02 February 2011 at 7:39am
Thanks, this one is fixed.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 02 February 2011 at 10:50am
Beautiful! Thanks Oleg.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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