//readonly ProcCardDataSet _ds = new ProcCardDataSet(); private void FrmPrint_Load(object sender, EventArgs e) { //var sql = "SELECT a.*,c.Dept FROM udstr a LEFT JOIN dbo.udone b ON b.sgdhao=a.sgdhao " + // "LEFT JOIN DZDJ.dbo.TB_Dept c ON c.ID=b.DeptId " + // $"WHERE zling='{SqlHelper.ProcCardNo}' AND DeptId='{SqlHelper.DeptId}' ORDER BY a.gxone,a.gxtwo"; //SqlHelper.FillDataset(SqlHelper.GetConnection(), CommandType.Text, sql, _ds, new string[] {"ProcCard"}); var cardDataSet = ProcCard.GetProcCardDataSet(SqlHelper.ProcCardNo); var rds = new ReportDataSource("ProcCard", cardDataSet.Tables[0]); reportViewer1.LocalReport.ReportPath = "ProcCard.rdlc"; reportViewer1.LocalReport.DataSources.Add(rds); reportViewer1.RefreshReport(); }
private void InitDataGridView3() { var ds = ProcCard.GetProcCardDataSet(txtProcCardNo2.Text.Trim()); dataGridView3.DataSource = ds.Tables[0]; dataGridView3.AutoResizeColumns(); //for (int i = 0; i < dataGridView3.ColumnCount; i++) //{ // dataGridView3.Columns[i].Width = 100; //} //dataGridView3.Columns[0].Width = 100; //dataGridView3.Columns[1].Width = 100; //dataGridView3.Columns[2].Width = 100; //dataGridView3.Columns[3].Width = 100; //dataGridView3.Columns[4].Width = 100; //dataGridView3.Columns[5].Width = 100; //dataGridView3.Columns[6].Width = 100; //dataGridView3.Columns[7].Width = 100; //dataGridView3.Columns[8].Width = 100; //dataGridView3.Columns[9].Width = 100; //dataGridView3.Columns[10].Width = 100; dataGridView3.Sort(dataGridView3.Columns[1], ListSortDirection.Ascending); }