473,395 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Dynamically add Image on crystal report vb.net

I am working on project . I have to Retrieve image from Database Table (table 1) . Image is stored in Image data-type in table 1 . Then i have to put this image on crystal report. I have searched a lot for this topic but not successfully completed this task.

Actually i want to retrieve the employee details along with their images from database and get all on crystal report

I am using :-
vs 2010
SAP crystal reports 13
using vb or c#

Here is code that i am using :
Expand|Select|Wrap|Line Numbers
  1. Dim con As New SqlConnection("Data Source=HB-6F0B5AC76D8E;Initial Catalog=putimage;Integrated Security=True")
  2.         con.Open()
  3.         Dim cmd As New SqlCommand("select * from table1", con)
  4.         Dim da As New SqlDataAdapter
  5.         da.SelectCommand = cmd
  6.         Dim ds As New DataSet
  7.         da.Fill(ds)
  8.         Dim a As Byte() = ds.Tables(0).Rows(0).Item(0)
  9.         Dim b = ds.Tables(0).Rows(0).Item(0)
  10.         Dim ms As New System.IO.MemoryStream(a)
  11.         Dim img As System.Drawing.Image = System.Drawing.Image.FromStream(ms)
  12.         Dim dt As New DataTable
  13.         dt.Columns.Add("pic")
  14.         dt.Rows.Add(b)
  15.  
  16.         'rpt.Load("S:\vb & vb.net\project done\WindowsApplication3\WindowsApplication3\CrystalReport1.rpt")
  17.         'rpt.SetDataSource(dt)
  18.         'Form2.CrystalReportViewer1.ReportSource = rpt
  19.         '  Form2.Show()
  20.  
  21.         PictureBox1.Image = img
  22.         MsgBox("DONE")
  23.  
  24.         cmd.Dispose()
  25.         con.Dispose()
  26.  
Dec 7 '13 #1
0 3412

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
2
by: Sam | last post by:
Hello everyone, I have a table, which contains a picture column, I put URL info into it. "www.myweb.com/1.jpg..." I want to show this picture in my crystal report, I find some samples show the...
0
by: BATISTA | last post by:
Hi , I am working in c# with crystal report XI. I read an example about dynamic image location .. 1) In that we have a xml xchema file with two fields n amed country--datatype is string,...
5
by: Damir | last post by:
Please I need help and dont know where to post the question..... So I am making a small asp.net application and need to generate a crystal report with one image that changes depending of some data....
0
by: Saaima | last post by:
Hi All when I store a picture of size 800*600 pixels in database (SqlServer) field Photo (Image) and load it into crystal report through query by dragging and dropping the field on report it...
1
by: rajpar | last post by:
Hi! All I m working on crystal reports with ASP.NET2.0. I have to place logo dynamically on crystal report. to do this. i create a dataSet -> DataTable -> and add one Column name Picture & set...
0
by: swatii | last post by:
I am developing application in c#.net and I am using crystal reports. I want to dynamically load crystal report in report document so that from the same form I can access all the reports. for this...
1
by: saifulhaque | last post by:
Dear How can add database field dynamically into Crystal report using C#. I want to get change crystal report with respect to Database field.
0
by: saifulhaque | last post by:
Dear All How we can assign column of table to Crystal report using sql query. Means sq l query is varying w.r.t purpose. Ex: Some times select * from table or Some times...
2
by: heemanshubhalla | last post by:
I am working on project . I have to Retrieve image from Database Table (table1) . Image is stored in Image datatype in table1 . Then i have to put this image on crystal report. I have searched a lot...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.