Public Sub Preview_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cryRpt As New PreviewReport Dim sample As New DataSet Dim FS As FileStream Dim DTImage As New DataTable("Load_Image") Dim DTText As New DataTable("Load_Word") Dim IRow As DataRow DTImage.Columns.Add("HeaderImage", System.Type.GetType("System.Byte[]")) IRow = DTImage.NewRow Dim IR As BinaryReader cryRpt.Load("F:\Projects\2008 Projects\VB.NET\Print from wordpad\Print from wordpad\PreviewReport2.rpt") FS = New FileStream(Load_MS_Word.getfilepath, FileMode.Open) IR = New BinaryReader(FS) Dim imgbyte(FS.Length) As Byte imgbyte = IR.ReadBytes(Convert.ToInt32((FS.Length))) IRow(0) = imgbyte DTImage.Rows.Add(IRow) sample.Clear() sample.Tables.Add(DTImage) sample.Tables.Add(DTText) IR.Close() FS.Close() DTText.Columns.Add("RTFText", GetType(String)) DTText.Rows.Add(Picture) cryRpt.SetDataSource(sample) CrystalReportViewer1.ReportSource = cryRpt CrystalReportViewer1.Refresh() End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)