スプレッドシートのギアコントロールを使用してExcelの行をマージする必要があります。単一の列の特定の行のみExcelにエクスポートするときにスプレッドシートギアを使用して行を1つにマージする
All detail is being included in this screencast
私が行われている変更を追加する必要がありますどのような
DataTable dt = (DataTable)ViewState["dtGrid"]
System.Random rd = new System.Random(DateTime.Now.Millisecond);
int MyValue = rd.Next(1000000, 99999999);
sUniqueName = MyValue.ToString();
// Create a new workbook.
SpreadsheetGear.IWorkbook workbook = SpreadsheetGear.Factory.GetWorkbook();
SpreadsheetGear.IRange cells = workbook.Worksheets[0].Cells;
cells.CopyFromDataTable(dt, SpreadsheetGear.Data.SetDataFlags.None);
cells.Rows[0, 0, 0, 51].Interior.Color = System.Drawing.Color.Navy;
cells.Rows[0, 0, 0, 51].Font.Color = System.Drawing.Color.White;
cells["A:R"].Columns.AutoFit();
string filename = string.Format("{0}-{1}-{2}", "AOMIndoorInventoryReport", DateTime.Now.ToString("MM-dd-yy"), sUniqueName);
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename + ".xls");
workbook.SaveToStream(Response.OutputStream, SpreadsheetGear.FileFormat.Excel8);
Response.End();
のですか?
私は上記の例ではA7とA8の代わりに最初の例で渡す必要がありますようにマージする必要があります動的行があります。 –