Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Format
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Format

 Post Reply Post Reply
Author
Message
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Topic: Format
    Posted: 23 June 2011 at 11:08am
Hi
I really need some help.
 
I thought I was on to a winner by using the format function
rRecord.Item(W_LISTPRICE).Format ="HK$ %s"
It work's great.
 
But when I come to edit the value it will not enter some times.
 
If I highlight the whole text lets say HK$ 23.45 and over write all of it with 234.45 great it will work.
if I place the curser just after the 3 and make it 234.45 and click away it reverts back to HK$ 23.45
 
Whats strange is if i use ="£ %s" then it work both ways.
 
I do hope this makes sense, and someone can help.
I am still on ver 13.0.0
 
See code below as an example
Many Thanks
 
Mark
 
 
Private Sub Form_Load()
Dim rRecord As ReportRecord
Dim Column As ReportColumn
Dim Item As ReportRecordItem
wndProducts.AllowEdit = True
wndProducts.EditOnClick = True
 
Set Column = wndProducts.Columns.Add(0, "List Price1", 70, True)
Column.Visible = True
Column.Editable = True
Column.EditOptions.SelectTextOnEdit = True
Set Column = wndProducts.Columns.Add(1, "List Price2", 70, True)
Column.Visible = True
Column.Editable = True
Column.EditOptions.SelectTextOnEdit = True

Set rRecord = wndProducts.Records.Add()
Set Item = rRecord.AddItem("")
Item.Format = "HK$ %s"
Item.Value = 23.45
Set Item = rRecord.AddItem("")
Item.Format = "£ %s"
Item.Value = 23.45
wndProducts.Populate
End Sub
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
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: 23 June 2011 at 1:32pm

Hi Mark,

I have been struggling with this also and didn't succeed either so I have to disappoint you with this one. To get this working I used BeforeDrawRow event to render "Markup format" and in my case it works OK. Maybe an option for you? Don't know if editing ReportItem (without showing entire Markup string) is possible in V13.0 but you can give it a try...

 
Add in your sample:
 
wndReportControl.EnableMarkup = True 
wndReportControl.SetCustomDraw xtpCustomBeforeDrawRow
 
 
Private Sub wndReportControl_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
   
    Metrics.Text = "<TextBlock>" & "HR$" & " <Bold Foreground='Gold'><Italic>" & Row.Record(Item.index).Caption & "</Italic></Bold></TextBlock>"
   
End Sub
 
 
and remove the .Format when adding Report items
 
 
Output:
 
 
 
 
A lot of possibilities using Markup & BeforeDrawRow event which you don't have with .Format property Wink
 
 
Good luck
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
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 23 June 2011 at 3:37pm

Hi Aaron.

 

Really, many thanks for your reply.

 

You know what's it like, your implement what you think will work and then you hit a brick wall.

I have been working around so many “get arounds” on this, and spending so much time, because it seems such a perfect solution, using the format thing, and then it doesn’t quite work when you come to use it.

 

Tonight though I did find another work around for this.

 

What I did was use the ValueChanging event

 

 

Private Sub wndProducts_ValueChanging(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, NewValue As Variant, Cancel As Boolean)

 

Dim strValue As String

strValue = fnValue(NewValue)

 

If IsNumeric(strValue) = True Then

    Item.Value = CDbl(strValue)

End If

End Sub

 

 

 

NewValue is the caption from the Item.

 

fnValue strips the currency symbol and only returns the numeric value.

 

and then I set the item.value to it, and ........ Well it works.

 

But heck, it seems a bit of a bodge.

 

I still can't think why a format for £ works with out this, my PC is UK British so the default currency is £, but why would that make a difference!

 

I don't know if this will work with future versions, even though I have a fully paid up support I can't just issue a new set-up to be run on hundred's of PC's

 

What do you think?

 

Thanks for the reply.

 

Many Many Thanks

 

Mark

 
 
 
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
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: 24 June 2011 at 10:19am
Hi Mark,
 
I don't know if you already created setup for your customers... If not I would reconsider using the option I gave you. Really, BeforeDrawRow event is my best friend and I use it whenever I need to customize the contents (visually) without changing the 'original' content of a ReportItem. If you need help with something you can always post problem Wink
 
 
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
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 27 June 2011 at 5:27am

Hi Aaron

Our customers have been on ver. 13.0.0 nearly since it was released. So doing an setup update is a real pain.

It would be OK if the users had Admin rights but most don't, so I can't even run an automated update, we would have to get their IT support people involved and that is a great problem.

Our main application is a single exe on the server and all users have a short cut to this, so updating the app is easy.

I will look at the Markup option, if you use it with no problems then it does seem the correct way forward.

Many Thanks again for your help and supporting this forum.

Mark

Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
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.250 seconds.