Hi guys i have proplem I create crystal report(blank report) to show the data of employee from database hrdata on table Employee based on stored procedurehis name is ShowEmployee when he write EmployeeNo in textbox1 control show employee detailesas name,address,nationality,branch,join date,birth date,personal picturebut personal picture field not exist in database so that i need to show the picture from localpath from local hard diskMeaning when i write in textbox1 employee no as 1233 show1- detailes from database and that i already done2-show image from local hard disk based on textbox1 (employee no) not donei need code by c# to show image in crystal report from local drive based on employee nohow i do thatusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Configuration;using CrystalDecisions.CrystalReports.Engine;using CrystalDecisions.ReportSource;using CrystalDecisions.Shared;using CrystalDecisions.Windows.Forms;
namespace FleetManagment{ public partial class ShowEmployeeRecord : Form { public ShowEmployeeRecord() { InitializeComponent(); }private Reports.DateBaseReport objMyReport; private ConnectionInfo objConnectionInfo; private void setSQLParams(){ParameterField objParameterField =crystalReportViewer1.ParameterFieldInfo[0];ParameterDiscreteValue objParameterDiscreteValue;objParameterDiscreteValue = new ParameterDiscreteValue();objParameterDiscreteValue.Description = "@EmployeeNo";objParameterDiscreteValue.Value = Convert.ToDateTime (textbox1.text);objParameterField.CurrentValues.Add(objParameterDiscreteValue);crystalReportViewer1.ParameterFieldInfo.Add(objParameterField);objParameterField = crystalReportViewer1.ParameterFieldInfo[1];}
private void setDatabaseSettings(){objConnectionInfo = new ConnectionInfo();objConnectionInfo.ServerName = "192.168.1.5";objConnectionInfo.DatabaseName = "hrdata";objConnectionInfo.UserID = "sa";objConnectionInfo.Password = "1234";}
private void refreshReport(){ Tables tables =Tables tables = objMyReport.Database.Tables;foreach (Table tbl in tables){TableLogOnInfo objTableLogOnInfo = new TableLogOnInfo();objTableLogOnInfo.ConnectionInfo = objConnectionInfo;tbl.ApplyLogOnInfo(objTableLogOnInfo);} crystalReportViewer1.ReportSource = objMyReport; setSQLParams();}
private void crystalReportViewer1_ReportRefresh(object source, CrystalDecisions.Windows.Forms.ViewerEventArgs e){e.Handled = true; ((ReportClass)crystalReportViewer1.ReportSource).Refresh(); }
private void button2_Click(object sender, EventArgs e){objMyReport = new Reports.DateBaseReport(); setDatabaseSettings(); refreshReport();
}}}