Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Progress bar in a cell
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Progress bar in a cell

 Post Reply Post Reply
Author
Message
Franco Prudente View Drop Down
Newbie
Newbie


Joined: 01 December 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Franco Prudente Quote  Post ReplyReply Direct Link To This Post Topic: Progress bar in a cell
    Posted: 28 March 2007 at 8:29am
Hi, i would add a progress bar in a cell.
How can i do?
Thanks
Back to Top
fantama View Drop Down
Groupie
Groupie
Avatar

Joined: 12 October 2006
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote fantama Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2007 at 9:09am
I would like to know too.  Please post some code actually doing this instead of saying use DrawItem event etc......  Would be nice if it did not take up entire cell and had a nice border around it.
Thanks
Back to Top
pcmaker View Drop Down
Groupie
Groupie
Avatar

Joined: 05 May 2005
Location: Venezuela
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote pcmaker Quote  Post ReplyReply Direct Link To This Post Posted: 29 March 2007 at 3:00pm
QUE TAL GENTE.

LES PUEDO ESCRIBIR EN ESPAÑOL PARA ENTENDERNOS MEJOR.

YO SE LA MANERA PARA HACER LO QUE NECESITAN!
Back to Top
fantama View Drop Down
Groupie
Groupie
Avatar

Joined: 12 October 2006
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote fantama Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2007 at 9:31am
Gan we get an answer to this please?
Back to Top
BagLady View Drop Down
Newbie
Newbie
Avatar

Joined: 28 May 2006
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote BagLady Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2007 at 9:33am
Any chance you can post a sample on how to do this, I have been following this thread for a while and am finally adding something as I see no response  This is very important to us.
Back to Top
pcmaker View Drop Down
Groupie
Groupie
Avatar

Joined: 05 May 2005
Location: Venezuela
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote pcmaker Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2007 at 1:36pm
In VB6
1º  Put this in column declare:
wnd_rpc.SetCustomDraw xtpCustomBeforeDrawRow + xtpCustomDrawItem

2º In wnd_rpc_DrawItem event, this:
Private Sub wndAct_DrawItem(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal hdc As stdole.OLE_HANDLE, ByVal left As Long, ByVal top As Long, ByVal right As Long, ByVal bottom As Long, DoDefault As Boolean)
If Column.Index = X Then
    drawProgressCell Item, hdc, left, top, right, bottom, Row.Record.Index
End If
End Sub
Where Column.Index = X is the column where you want use the progress bar.

3º The implement of drawProgressCell sub:
Sub drawProgressCell(Item As ReportRecordItem, hdc As stdole.OLE_HANDLE, _
    left As Long, top As Long, right As Long, bottom As Long, row_index As Long)
Dim rec_porct As Long
Select Case Item.Value
    Case Is < 10
        FillBrush = CreateSolidBrush(vbRed)
    Case Is = 100
        FillBrush = CreateSolidBrush(vbGreen)
    Case Else
        FillBrush = CreateSolidBrush(Me.BackColor)
End Select
DeleteObject SelectObject(hdc, FillBrush)
rec_porct = (Item.Value * (right - left)) / 100
RectangleX hdc, left, top + 1, left + rec_porct, bottom - 1
End Sub

4º In add_records sub, fill value of the progress cell with this:
Record.AddItem Format(va_porct, "###,##0.00")
        Record.Item(5).Format = "%s%%"
        Record.Item(5).ToolTip = va_porct & "%"
        Record.Item(5).ForeColor = vbBlack
This format the number, in order to keep the original value(double) in the value of cell.

I take a vacation until april 9.

I hope that this reply help you in your problems.

Bye, Juan Quintero - Venezuela.

PD: my englhis is bad, excuseme.
Back to Top
Franco Prudente View Drop Down
Newbie
Newbie


Joined: 01 December 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Franco Prudente Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2007 at 3:46am
Thanks, i will try to implement this in C# code...
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.234 seconds.