Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

Pictures in reports

$
0
0

I am interested in putting pictures in reports, I am interested in putting the clients logos onto crystal reports.

 

I wanted to try and extract a picture from the database and output it in a certain IBlobFieldObject. I am using the code below in an attempt to do that but it gave me the error "Unable to cast object of type 'System.Byte[]' to type 'CrystalDecisions.CrystalReports.Engine.BlobFieldObject'.".

 

 

 


 Dim ReportTitle As CrystalDecisions.CrystalReports.Engine.BlobFieldObject

 

 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load        Dim rpt As New CrystalReport3           Dim iSql As String = "Select Picture from MyImages where ID =5"        Dim da As New OleDbDataAdapter(iSql, Con)        Dim dTable As New DataTable        dTable.Clear()        da.Fill(dTable)        ReportTitle = rpt.ReportDefinition.Sections(0).ReportObjects("Picture1")        ReportTitle = dTable.Rows(0)("Picture")        'ReportSiteName = rpt.ReportDefinition.Sections(0).ReportObjects("text2")        'ReportSiteName.Text = dTable.Rows(0)("SiteName").ToString        'ReportSiteName = rpt.ReportDefinition.Sections(0).ReportObjects("text4")        'ReportSiteName.Text = dTable.Rows(0)("SiteName").ToString        rpt.SetDataSource(dTable)        CrystalReportViewer1.ReportSource = rpt    End Sub

Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>