Picture in CR for VS.NET - very simple question 
Author Message
 Picture in CR for VS.NET - very simple question

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?

Regards,

Denis



Mon, 25 Jul 2005 16:48:27 GMT  
 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



Mon, 25 Jul 2005 21:57:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Find good book about using CR.NET with VS.NET and .NET Framework

2. VS.Net + Cr.Net and VB.Net

3. Simple question - CR for .NET

4. CR 8.5 and CR from VS.Net package

5. VS .NET 2002 upgrade to 2003 and CR.NET

6. CR .Net is bundled with VS .Net?

7. Using CR for VS.NET and CR8.5

8. CR VS.NET - runtime error

9. Modify filename of picture in CR for .NET dynamically

10. Newbie to CR for VS.NET

11. UnboundField in CR for VS.net?

12. VS.NET 2003 project back to VS.NET 2002

 

 
Powered by phpBB® Forum Software