mostafarastin239
سه شنبه 03 خرداد 1390, 14:43 عصر
سلام به همه،
من می خواهم بعد از اینکه اطلاعات فاکتور در سیستم ثبت شد شماره فاکتور را به قسمت مربوط به چاپ ارسال کنم و توسط لود فرم چاپ توسط ریپورت ویور اطلاعات همان فاکتور را چاپ کنم. کد زیر را نوشتم ولی جواب نمی دهد. shfa همان شماره فاکتور است که از فرم فاکتور به فرم پرینت ارسال می شود.
private void report_Load(object sender, EventArgs e)
{
try
{
SqlDataAdapter objdataadapter = new SqlDataAdapter();
DataSet dstmp = new DataSet();
DataTable dstmp1 = new DataTable();
objdataadapter.SelectCommand = new SqlCommand();
objdataadapter.SelectCommand.Connection = objconnection;
objdataadapter.SelectCommand.CommandText = "SELECT shomare_factor , code_kala , nam_kala , sathe_joz , tedad , sathe_kol" + " , fee_vahed , fee_kol , tedad_kala , mablaghe_kol , takhfif , pardakht FROM factor where shomare_factor = '" + shfa + "'";
objdataadapter.SelectCommand.CommandType = CommandType.Text;
objconnection.Open();
objdataadapter.Fill(dstmp, "factor");
objdataadapter.Fill(dstmp1);
ReportDataSource repds = new ReportDataSource("dstmp", dstmp.Tables["dstmp1"]);
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DataSources.Add(repds);
reportViewer1.LocalReport.Refresh();
this.reportViewer1.RefreshReport();
objconnection.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
با تشکر
من می خواهم بعد از اینکه اطلاعات فاکتور در سیستم ثبت شد شماره فاکتور را به قسمت مربوط به چاپ ارسال کنم و توسط لود فرم چاپ توسط ریپورت ویور اطلاعات همان فاکتور را چاپ کنم. کد زیر را نوشتم ولی جواب نمی دهد. shfa همان شماره فاکتور است که از فرم فاکتور به فرم پرینت ارسال می شود.
private void report_Load(object sender, EventArgs e)
{
try
{
SqlDataAdapter objdataadapter = new SqlDataAdapter();
DataSet dstmp = new DataSet();
DataTable dstmp1 = new DataTable();
objdataadapter.SelectCommand = new SqlCommand();
objdataadapter.SelectCommand.Connection = objconnection;
objdataadapter.SelectCommand.CommandText = "SELECT shomare_factor , code_kala , nam_kala , sathe_joz , tedad , sathe_kol" + " , fee_vahed , fee_kol , tedad_kala , mablaghe_kol , takhfif , pardakht FROM factor where shomare_factor = '" + shfa + "'";
objdataadapter.SelectCommand.CommandType = CommandType.Text;
objconnection.Open();
objdataadapter.Fill(dstmp, "factor");
objdataadapter.Fill(dstmp1);
ReportDataSource repds = new ReportDataSource("dstmp", dstmp.Tables["dstmp1"]);
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DataSources.Add(repds);
reportViewer1.LocalReport.Refresh();
this.reportViewer1.RefreshReport();
objconnection.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
با تشکر