I am not able to see any image on Crystal Report at Run time.
So how can I load any image which is saved in local disk so
that it can be viewed at Runtime in Crystal reports?
Answers were Sorted based on User's Feedback
Answer / peerzada
You may have used Link Image at design time (while
inseerting OLE object) therefore report requires it on
machine on whihc report will be run. One can solve this
problem by embeding image in report rather than linking it
(by unchecking Link opetion while selecting image).
| Is This Answer Correct ? | 12 Yes | 4 No |
Answer / deepak kumar
write the column of Byte array Type
And pass Tha byte data into this column
and drag the column to the crystal report.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / vishu
try {
// here i have define a simple datatable inwhich
image will recide
DataTable dt = new DataTable();
// object of data row
DataRow drow;
// add the column in table to store the image of
Byte array type
dt.Columns.Add("Image", System.Type.GetType
("System.Byte[]"));
drow = dt.NewRow;
// define the filestream object to read the image
FileStream fs;
// define te binary reader to read the bytes of
image
BinaryReader br;
// check the existance of image
if (File.Exists
(AppDomain.CurrentDomain.BaseDirectory + "10157.Jpg")) {
// open image in file stream
fs = new FileStream
(AppDomain.CurrentDomain.BaseDirectory + "10157.Jpg",
FileMode.Open);
}
else {
// if phot does not exist show the nophoto.jpg
file
fs = new FileStream
(AppDomain.CurrentDomain.BaseDirectory + "NoPhoto.jpg",
FileMode.Open);
}
// initialise the binary reader from file
streamobject
br = new BinaryReader(fs);
// define the byte array of filelength
byte[] imgbyte = new byte[fs.Length + 1];
// read the bytes from the binary reader
imgbyte = br.ReadBytes(Convert.ToInt32
((fs.Length)));
drow(0) = imgbyte;
// add the image in bytearray
dt.Rows.Add(drow);
// add row into the datatable
br.Close();
// close the binary reader
fs.Close();
// close the file stream
CrystalReport1 rptobj = new CrystalReport1();
// object of crystal report
rptobj.SetDataSource(dt);
// set the datasource of crystalreport object
CrystalReportViewer1.ReportSource = rptobj;
//set the report source
}
catch (Exception ex) {
// error handling
Interaction.MsgBox("Missing 10157.jpg or
nophoto.jpg in application folder");
}
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / rajavivekvarma
If you are working with version 11 , then drag and drop an
ole object rt click on format graphic --> go to picture tab
--> Graphic Location -->enter your path in the formula.
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / diji varghese
Crystal report not supporting some format like gif
| Is This Answer Correct ? | 0 Yes | 2 No |
Is there a way to export a report definition without writing code?
to ensure that all of the data from a field is displayed in a report text object you should do which of the following?? a) use the format wizard b) size the text object manually c) select the auto format option for the text object d) select the can grow option for the text object e) set the can grow option to the details section of the report
Where is the image located, after youve placed it on the report?
How to print two details fields at the bottom of the page
Can we call or add subreport within subreport?
How to open subreport in new ie window using hyperlink button. I used target=new; in the formula field. But it overrides the main window and show the report?
What are the advantages or disadvantages of using Crystal Reports in a Windows Forms application as opposed to say rolling our own reports as HTML and displaying them in the Internet Explorer control?
What all performance improvement techniques used in crystal reports? (Particularly cr xi)?
Reports can be optimized for web viewing using which of the following strategies: a. Using subreports instead of linking tables b. Avoiding maps c. Using the Page N of M special field to help users understand how many pages are in the report d. Saving reports as version 10 e. Avoiding reports with drill-down capabilities
How many .rpt files are be there in a main report having 2 sub reports?
17 Answers Accenture, Cap Gemini, CTS,
What does it mean when we get the error message "Invalid report version" when try to open a Crystal Report?
I am not able to see any image on Crystal Report at Run time. So how can I load any image which is saved in local disk so that it can be viewed at Runtime in Crystal reports?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)