I'm trying to insert a picture into a ReportControl first but when i invoke RPPrint.SetCustomDraw xtpCustomBeforeDrawRow the picture disappear , here is the code :
--------------------------------------------------------------------------------------------------
-- declaring my column then adding data :
Dim rptRec As XtremeReportControl.ReportRecord
Dim rptItm As XtremeReportControl.ReportRecordItem
Dim rptCol As XtremeReportControl.ReportColumn
i = 1001
With RPPrint.Icons
.LoadBitmap App.Path & "\Res\BNPPARIBAS_SMALL_S027E001.png", i, xtpImageNormal
End With
Set rptRec = RPPrint.Records.Add()
Set rptItm = rptRec.AddItem("")
Set rptItm = rptRec.AddItem("")
rptItm.Alignment = xtpAlignmentIconRight Or xtpAlignmentRight
rptItm.Icon = i
Set rptItm = rptRec.AddItem("")
Set rptItm = rptRec.AddItem("")
Set rptItm = rptRec.AddItem("")
Set rptItm = rptRec.AddItem("")
Set rptItm = rptRec.AddItem("")
Set rptItm = rptRec.AddItem("")
Set rptItm = rptRec.AddItem("")
'------------------here the picture is merge on 7 col cos it's big
rptRec.Records.MergeItems 0, 0, 1, 7
Set rptRec = RPPrint.Records.Add()
Set rptItm = rptRec.AddItem("0123456789")
rptItm.Alignment = xtpAlignmentLeft Or xtpAlignmentWordBreak
Set rptItm = rptRec.AddItem("RAISON SOCIALE LONGUE")
rptItm.Alignment = xtpAlignmentLeft Or xtpAlignmentWordBreak
Set rptItm = rptRec.AddItem("0123456789")
rptItm.Alignment = xtpAlignmentLeft
Set rptItm = rptRec.AddItem("0123456789")
rptItm.Alignment = xtpAlignmentLeft
Set rptItm = rptRec.AddItem("0123456789")
rptItm.Alignment = xtpAlignmentLeft
Set rptItm = rptRec.AddItem("0123456789")
rptItm.Alignment = xtpAlignmentLeft
Set rptItm = rptRec.AddItem("31/01/2011")
rptItm.Alignment = xtpAlignmentCenter
Set rptItm = rptRec.AddItem("31/01/2011")
rptItm.Alignment = xtpAlignmentCenter
Set rptItm = rptRec.AddItem("999 999 999,99")
rptItm.Alignment = xtpAlignmentRight
RPPrint.SetCustomDraw xtpCustomBeforeDrawRow
With RPPrint
.Populate
For Each rptCol In .Columns
rptCol.BestFit
Next
End With
--------------------------------------------------------------------------------------------------