如何在水晶报表中动态显示图像 [英] How to show image dynamically in crystal report
本文介绍了如何在水晶报表中动态显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在访问数据库中插入图像如何在水晶报表中动态显示图像c#
how to insert image in access database How to show image dynamically in crystal report c#
推荐答案
此链接可以帮助您.. :)
示例1 [ ^ ]
示例2 [ ^ ]
示例3 [ ^ ]
Crystal Reports中的图像 [ ^ ]
如何使用Visual Studio 2005在Crystal Reports中动态加载图像 [ ^ ]
this link may help you.. :)
example 1[^]
example 2[^]
example 3[^]
Image in Crystal Reports[^]
How to dynamically load images in Crystal Reports using Visual Studio 2005[^]
private void Submit_Click(object sender, EventArgs e)
{
byte[] picbyte = System.IO.File.ReadAllBytes(textBox.Text);
try
{
string constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\\PIS(ACU).mdb;";
Con = new OleDbConnection(@constr);
Con.Open();
Com = new OleDbCommand();
Com.Connection = Con;
Com.CommandText = "INSERT INTO Pics(Patient_Id,ImageDate,Photo)VALUES(" + txtPatientId.Text + ",'" + txtImageDate.Value.ToString("yyyy/MM/dd HH:mm:ss") + "', @Photo)";
OleDbParameter picParam = Com.Parameters.Add("@Photo", SqlDbType.Binary);
picParam.Value = picbyte.ToArray();
picParam.Size = picbyte.ToArray().Length;
Com.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
Con.Close();
MessageBox.Show("Image Uploaded Successfully", "PIS System");
DiseaseRecord D = new DiseaseRecord();
D.Show();
this.Close();
}
}
private void btnBrowse_Click(object sender, EventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();
fd.InitialDirectory = "c:\\";
// DialogResult Result = fd.ShowDialog();
if (fd.ShowDialog() == DialogResult.OK)
{
textBox.Text = fd.FileName.ToString();
pictureBox.ImageLocation = textBox.Text;
}
Console.ReadLine();
}
这篇关于如何在水晶报表中动态显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文