Inserting graphical elements with OUTREACH|IT Advanced Report Designer
Adding a picture to an e-mail can change the read-and-response rate. A newsletter gets a nice new feel, an info mail seams more personal. Since e-mails were never meant to send large data packages, it is better to uplaod the pictures to your FTP server and simply add the picture’s location and other information (size, position) to the e-mail. This is done via HTML code and if you do not regularly work with HTML, here is a script block you can copy and paste to your template.
Open the template window, select „Scripts“-view and copy paste the following scripture:
Private Sub Picture_HtmlItemCreated(ByVal sender As Object, ByVal e As DevExpress.XtraReports.UI.HtmlEventArgs)
e.ContentCell.Controls.Clear()
Dim convertedSizeW as Integer
Dim convertedSizeH as Integer
Dim controlSize as Size = CType(sender, XRControl).Size
Select Case xtraReport1.ReportUnit
Case ReportUnit.HundredthsOfAnInch
convertedSizeW = GraphicsUnitConverter.Convert(controlSize, GraphicsUnit.Document, GraphicsUnit.Inch).Width / 100
convertedSizeH = GraphicsUnitConverter.Convert(controlSize, GraphicsUnit.Document, GraphicsUnit.Inch).Height / 100
Case ReportUnit.TenthsOfAMillimeter
convertedSizeW = GraphicsUnitConverter.Convert(controlSize, GraphicsUnit.Document, GraphicsUnit.Millimeter).Width * 4.4776119
convertedSizeH = GraphicsUnitConverter.Convert(controlSize, GraphicsUnit.Document, GraphicsUnit.Millimeter).Height * 4.4776119
End Select
Dim s As String = „<a href='“ & (CType(sender, XRControl)).Tag.ToString() & „‚>“ & „<img src='“ & (CType(sender, XRPictureBox)).ImageUrl.ToString() & „‚ width='“ & convertedSizeW & „‚ height='“ & convertedSizeH & „‚ border=’0‘>“ & „</a>“
e.ContentCell.InnerHtml = s
End Sub
Then select the picture box you have created and on the right in the settings table, „Property Grid“ move down to „Behaviour“ – „Scripts“
<
Neueste Kommentare