Print Page | Close Window

Insert image in some cell of the report ?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=5772
Printed Date: 29 March 2024 at 11:44am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Insert image in some cell of the report ?
Posted By: mav46
Subject: Insert image in some cell of the report ?
Date 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



Replies:
Posted By: sserge
Date Posted: 13 December 2006 at 3:27pm
Yes, you can draw any custom picture inside a cell using wndReportControl_DrawItem handler.

--
WBR,
Serge


Posted By: mav46
Date 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


Posted By: sserge
Date 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


Posted By: mav46
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net