I've used the process of creating a dynamic image table and adding it to a crystal report at runtime many times in vb.net, but cannot get the same principle to work in an asp.net (VB) crystal report.
Basically I have a main report which will display the data, and a sub report that will contain the report title and the dynamic image.
The main report shows the data OK, but the subreport will not display the dynamic image, I just get a blank space.
Here is my code:
Public Sub CrystalDynImage() ' As DataTable
Dim dt As New DataTable("Images")
Dim drow As DataRow
'Dim ds As New DataSet
drow = dt.NewRow()
Dim fs As FileStream
Dim br As BinaryReader
fs = New FileStream(Session("logopath"), FileMode.Open)
br = New BinaryReader(fs)
Dim imgByte(fs.Length) As Byte
imgByte = br.ReadBytes(Convert.ToInt32((fs.Length)))
drow(0) = imgByte
rep = New ReportDocument()
repsub = rep.OpenSubreport("report_header.rpt")
Session("projectreport") = rep
Me.CrystalReportViewer1.ReportSource = Session("projectreport")
Sorry I have resolved it. My code is good, but the link between the Database fields and the report was out of date.
I will award points as the link that emoreau gave reminded me to Verifiy the Databse i.e
Crystal Reports -> Database -> Verify Database, this resolved my issue.