Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Insert image in some cell of the report ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Insert image in some cell of the report ?

 Post Reply Post Reply
Author
Message
mav46 View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2006
Location: Italy
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote mav46 Quote  Post ReplyReply Direct Link To This Post Topic: Insert image in some cell of the report ?
    Posted: 12 December 2006 at 5:57pm
There is a way to insert a bitmap (image) in some cell of the report ?
 
Thanks.
 
 
Product: Xtreme SuitePro (ActiveX) 12.1.1
Platform: Win XP (32bit)
Language: Visual Basic 6.0 SP5
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2006 at 3:27pm
Yes, you can draw any custom picture inside a cell using wndReportControl_DrawItem handler.

--
WBR,
Serge
Back to Top
mav46 View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2006
Location: Italy
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote mav46 Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2006 at 3:36pm
thank you for the response. Can you have an example to implement such functionality in this event handler ?
 
Please advice me.
 
 
 
 
Product: Xtreme SuitePro (ActiveX) 12.1.1
Platform: Win XP (32bit)
Language: Visual Basic 6.0 SP5
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2006 at 2:00pm
See an example below:


' enable sending events
wndReportControl.SetCustomDraw xtpCustomDrawItem + xtpCustomMeasureRow
' Set row size as picture height
Private Sub wndReportControl_MeasureRow(ByVal Row As XtremeReportControl.IReportRow, ByVal hDC As stdole.OLE_HANDLE, ByVal Width As Long, Height As Long)
'567 twips to a centimeter
Height = Image1.Picture.Height / 1000 * 567 / Screen.TwipsPerPixelX
End Sub
' Place inmage named Image1 to your form, select bitmap for it
Private Sub wndReportControl_DrawItem(ByVal Row As IReportRow, ByVal Column As IReportColumn, ByVal Item As 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.ItemIndex = COLUMN_SIZE Then

DoDefault = False

Dim pPicture As IPicture
Set pPicture = Image1.Picture
' Draw image to report cell
pPicture.Render hDC, left, top, right - left, bottom - top, _
0, pPicture.Height, pPicture.Width, -pPicture.Height, _
Null
End If

End Sub


--
WBR,
Serge
Back to Top
mav46 View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2006
Location: Italy
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote mav46 Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2006 at 2:33pm
ok, thank you
Product: Xtreme SuitePro (ActiveX) 12.1.1
Platform: Win XP (32bit)
Language: Visual Basic 6.0 SP5
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.172 seconds.