اشکان جان مرسی.سورس برنامه رو میزارم ببین میتونی کاری کنی.فقط اینو بدون که من از تو برنامه دیتاتیبلو پر میکنم و تو گزارش فراخونی میکنم.حالا وقتی که تو گزارش دو تا دیتا سور میزاری و تو برنامه دوتا Report.regdata میزاری هیچی رو تو گزارش نشون نمیده.خیلی گیرم به خدا
SqlConnection connect = newSqlConnection();
connect.ConnectionString = Ajans.Properties.Settings.Default.Connection.ToString();
try
{
connect.Open();
DataSet ds = newDataSet();
SqlDataAdapter insert = newSqlDataAdapter(@"select Namec as [ ],familyc as [ ],radeseni as [],Htb [ ] from customer where shgh='"+ShGH.Text +"' ", connect);
DataTable t = newDataTable(); insert.Fill(t);
SqlDataAdapter insert1 = newSqlDataAdapter(@"select * from customer where typePassenger='true' and shgh='" + ShGH.Text + "' ", connect);
DataTable t1 = newDataTable(); insert1.Fill(t1);
SqlDataAdapter mali = newSqlDataAdapter(@"select Timeraft as [ ],Tiketfrom as [],tiketbargashgt as [],DateHarekat as [] from customer where typePassenger='true' and shgh='" + ShGH.Text + "' ", connect);
DataTable air = newDataTable(); mali.Fill(air);
SqlDataAdapter insert3 = newSqlDataAdapter(@"select * from Setting ", connect);
DataTable t3 = newDataTable(); insert3.Fill(t3);
ds.Tables.Add(air);
ds.Tables.Add(t);
//return ds;
InterGharardad.Load("InterGharardad.mrt");
InterGharardad.RegData("test","Dt2",ds);
InterGharardad.RegData("test", "Dt1", ds);
//InterGharardad.RegData("Dt2",t);
// InterGharardad.RegData("Dt1", air);
// InterGharardad.Load("InterGharardad.mrt");
// InterGharardad.RegData("Dt1",air);
//InterGharardad.RegReportDataSources();
//InterGharardad.LoadFromString("InterGharardad.mrt" );
//((StiText)InterGharardad.Pages["Page1"].GetComponents()["countkol"]).Text.Value = t3.Rows[0][0].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["shgh"]).Text.Value = t1.Rows[0][1].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["NameUser"]).Text.Value = t1.Rows[0][14].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["Date"]).Text.Value = t1.Rows[0][10].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["Name"]).Text.Value = t1.Rows[0][2].ToString() + " " + t1.Rows[0][3].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["request"]).Text.Value = t1.Rows[0][13].ToString() ;
((StiText)InterGharardad.Pages["Page1"].GetComponents()["Count"]).Text.Value = t1.Rows[0][11].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["Addres"]).Text.Value = t1.Rows[0][68].ToString() ;
((StiText)InterGharardad.Pages["Page1"].GetComponents()["Tellmosafer"]).Text.Value = t1.Rows[0][66].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["Mobile"]).Text.Value = t1.Rows[0][4].ToString() ;
//((StiText)InterGharardad.Pages["Page1"].GetComponents()["Mobile"]).Text.Value = t1.Rows[0][2].ToString() ;
((StiText)InterGharardad.Pages["Page1"].GetComponents()["NameCompany"]).Text.Value = t3.Rows[0][0].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["addrescompany"]).Text.Value = t3.Rows[0][4].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["TellAjans"]).Text.Value = t3.Rows[0][1].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["Nametor"]).Text.Value = t1.Rows[0][18].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["From"]).Text.Value = t1.Rows[0][5].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["To"]).Text.Value = t1.Rows[0][55].ToString();
((StiText)InterGharardad.Pages["Page1"].GetComponents()["ezam"]).Text.Value = t1.Rows[0][5].ToString();
//((StiText)InterGharardad.Pages["Page1"].GetComponents()["kol"]).Text.Value = t1.Rows[0][25].ToString();
// ((StiText)InterGharardad.Pages["Page1"].GetComponents()["Nametor"]).Text.Value = t1.Rows[0][18].ToString();
//((StiText)InterGharardad.Pages["Page1"].GetComponents()["NameCompany"]).Text.Value = t2.Rows[0][0].ToString();
//((StiText)InterGharardad.Pages["Page1"].GetComponents()["TelN"]).Text.Value = t2.Rows[0][1].ToString();
// ((StiText)InterGharardad.Pages["Page1"].GetComponents()["FaxN"]).Text.Value = t2.Rows[0][2].ToString();
// ((StiText)InterGharardad.Pages["Page1"].GetComponents()["Address"]).Text.Value = t2.Rows[0][4].ToString();
/* if (checkBox6.Checked == true)
{
((StiText)RLeider.Pages["Page1"].GetComponents()["NameHotel"]).Text.Value = t1.Rows[0][17].ToString();
}
else
{
((StiText)RLeider.Pages["Page1"].GetComponents()["NameHotel"]).Text.Value = "";
}*/
// ((StiText)InterGharardad.Pages["Page1"].GetComponents()["Dateback"]).Text.Value = t1.Rows[0][55].ToString();
InterGharardad.Show();
}
catch (Exception x)
{
FarsiMessageBox.FMessageBox.Show(" ", "", FarsiMessageBox.FMessageBoxButtons.OK, FarsiMessageBox.FMessageBoxIcons.Warning, FarsiMessageBox.FMessageBoxDefaultButtons.Button1, x.Message.ToString());
}
finally
{
connect.Close();
}
}