lConnection myConnection = new SqlConnection(connectionString); SqlCommand Command = new SqlCommand(); Command.CommandText = "select origin ,report ,react_delay as 'reactionary delay' ,responsibility ,actions from signals_comm_failure where date = '" + TextBox1.Text + "' and id_class=1"; Command.Connection = myConnection; using (SqlDataAdapter da = new SqlDataAdapter(Command)) { DataTable dt = new DataTable(); da.Fill(dt); gd_dt.DataSource = dt; } Spire.DataExport.PDF.PDFExport PDFExport = new Spire.DataExport.PDF.PDFExport(); PDFExport.DataSource = Spire.DataExport.Common.ExportSource.DataTable; PDFExport.DataTable = this.gd_dt.DataSource as DataTable; PDFExport.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView; PDFExport.PDFOptions.PageOptions.Orientation = Spire.DataExport.Common.PageOrientation.Landscape; PDFExport.SaveToFile("Report.pdf"); SqlCommand Command2 = new SqlCommand(); Command2.CommandText = "select origin ,report ,cause ,responsibility ,actions from signals_comm_failure where date = '" + TextBox1.Text + "' and id_class =2"; Command2.Connection = myConnection; using (SqlDataAdapter da2 = new SqlDataAdapter(Command2)) { DataTable dt2 = new DataTable(); da2.Fill(dt2); outside_dt.DataSource = dt2; } Spire.DataExport.PDF.PDFExport PDFExport = new Spire.DataExport.PDF.PDFExport(); PDFExport.DataSource = Spire.DataExport.Common.ExportSource.DataTable; PDFExport.DataTable = this.outside_dt.DataSource as DataTable; PDFExport.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView; PDFExport.PDFOptions.PageOptions.Orientation = Spire.DataExport.Common.PageOrientation.Landscape; PDFExport.SaveToFile("Report.pdf");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)