displaying image as logo dynamically in report
CrystalReport1 r;
FileStream fs = new FileStream(@"C:\logo1.jpg", FileMode.Open);
BinaryReader br = new BinaryReader(fs);
byte[] pic = br.ReadBytes((int)fs.Length);
br.Close();
DataSet ds = new DataSet();
string strQry = "";
strQry="select * from customer";
m_Reader=m_GenDB.Reader(strQry);
ds.Tables.Add(this.GetTable(m_Reader));
ds.Tables[0].Columns.Add("Logo", typeof(byte[]));
ds.Tables[0].Rows[0]["Logo"] = pic;
r =new CrystalReport1();
r.m_StrReportName = "SaleReport.rpt";
r.SetDataSource(ds);
crystalReportViewer1.ReportSource = r;
COMMENT: I am using the code above to display my company logo on the crystal report . The logo is also displayed on the report but there is duplication of entries such that the whole list of entries repeates again and again many times . would any one help me what could be the problem here and how to solve it.
asad khan
|