public void showsales(string datefrom, string dateto, string user, DataGridView dvg) { CTU_BARCODE_READER.REPORT.DataSet1 ds = new CTU_BARCODE_READER.REPORT.DataSet1(); DataTable dt = ds.Tables["Sales"]; txtsalesdatefrom = (TextObject)s.ReportDefinition.Sections["PageHeaderSection2"].ReportObjects["datefrom"]; txtsalesdateto = (TextObject)s.ReportDefinition.Sections["PageHeaderSection2"].ReportObjects["dateto"]; txtuser = (TextObject)s.ReportDefinition.Sections["PageHeaderSection3"].ReportObjects["txtuser"]; txtsalesdatefrom.Text = datefrom; txtsalesdateto.Text = dateto; txtuser.Text = user; DataRow r; int i = 0; for (i = 0; i < dvg.Rows.Count; i++) { r = dt.NewRow(); r["Date"] = dvg.Rows[i].Cells[0].Value.ToString(); r["Description"] = dvg.Rows[i].Cells[3].Value.ToString(); r["Amount"] = dvg.Rows[i].Cells[2].Value.ToString(); dt.Rows.Add(r); } s.SetDataSource(ds.Tables[2]); cr.ReportSource = s; cr.Refresh(); f.ShowDialog(); }
public void showmanifestreport(string portfrom, string transaction, string ferry, string captain, string capacity, string travel, string arrival, string port, DataGridView dvg) { CTU_BARCODE_READER.REPORT.DataSet1 ds = new CTU_BARCODE_READER.REPORT.DataSet1(); DataTable dt = ds.Tables["Manifest"]; txtm4 = (TextObject)m.ReportDefinition.Sections["PageHeaderSection3"].ReportObjects["PORTFROM"]; txtm5 = (TextObject)m.ReportDefinition.Sections["PageHeaderSection2"].ReportObjects["TRANSNO"]; txtm6 = (TextObject)m.ReportDefinition.Sections["Section2"].ReportObjects["FERRY"]; txtm7 = (TextObject)m.ReportDefinition.Sections["Section2"].ReportObjects["TRAVEL"]; txtm8 = (TextObject)m.ReportDefinition.Sections["PageHeaderSection6"].ReportObjects["CAPTAIN"]; txtm9 = (TextObject)m.ReportDefinition.Sections["PageHeaderSection6"].ReportObjects["ARRIVAL"]; txtm10 = (TextObject)m.ReportDefinition.Sections["PageHeaderSection7"].ReportObjects["CAPACITY"]; txtm11 = (TextObject)m.ReportDefinition.Sections["PageHeaderSection7"].ReportObjects["PORT"]; txtm4.Text = portfrom; txtm5.Text = transaction; txtm6.Text = ferry; txtm7.Text = travel; txtm8.Text = captain; txtm9.Text = arrival; txtm10.Text = capacity; txtm11.Text = port; DataRow r; int i = 0; for (i = 0; i < dvg.Rows.Count; i++) { string id = dvg.Rows[i].Cells[0].Value.ToString(); string gen = "select gender from cinfo where idno = '" + id + "' "; DataTable dtable = new DataTable(); dtable = clsSQLClientFunctions.DataList(clsDeclaration.sLclSystemConnection, gen); string gender = clsSQLClientFunctions.GetData(dtable, "gender", "0"); r = dt.NewRow(); r["Name"] = dvg.Rows[i].Cells[1].Value.ToString().ToUpper(); r["Address"] = dvg.Rows[i].Cells[2].Value.ToString().ToUpper(); r["Category"] = dvg.Rows[i].Cells[3].Value.ToString(); r["status"] = dvg.Rows[i].Cells[5].Value.ToString(); r["gender"] = gender; dt.Rows.Add(r); } m.SetDataSource(ds.Tables[1]); cr.ReportSource = m; cr.Refresh(); f.ShowDialog(); }