
Picture in CR for VS.NET - very simple question
Quote:
> I use VB.NET and CR for .NET.
> I would like to put Company logo (my customers company logo, not my
company
> logo!) on report, but it should be dynamic. CR
> should take logo.gif file that is on the same location as report. If I
> change the logo.gif on the hard drive, it should appear in report without
> compiling new version of app (if I have 500 customers I dont want to
compile
> each version for each customer!). How should I do this?
Your picture MUST come from a database column. So that, you simply add a
column to your query and update programmatically this column using the
sample above:
Private Sub UpdateDataSetColumns()
Dim Row As DataRow
For Each Row In myDataSet.Tables(mytable).Rows
Dim strPath As String = "c:\........\logo.gif"
Dim fs As FileStream
fs = New FileStream(strPath, FileMode.Open, IO.FileAccess.Read)
Dim MyData As Byte()
ReDim MyData(CInt(fs.Length))
fs.Read(MyData, 0, System.Convert.ToInt32(fs.Length))
fs.Close()
Row(lColumnId) = MyData ' REPLACE lcolumnId by your column
Next
Row = Nothing
End Sub
Here is it.
Hopes it helps you.
MichaelP