Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach (Word.Row row in docTable.Rows)
- {
- foreach (Word.Cell cell in row.Cells)
- {
- if (row.Index == 1)
- {
- cell.Range.Text = table.Columns[cell.ColumnIndex - 1].Header.ToString();
- cell.Range.Font.Size = 10;
- cell.Range.Font.AllCaps = 1;
- cell.Range.Font.Bold = 1;
- }
- else
- {
- cell.Range.Text = sc.Convert(((DataRowView)table.Items[cell.RowIndex - 2]).Row.ItemArray[cell.ColumnIndex - 1].ToString());
- cell.Range.Font.Size = 10;
- }
- /*
- * Loopingnya bocor
- switch (cell.ColumnIndex - 1)
- {
- case 0:
- cell.Width = 20;
- break;
- case 1:
- cell.Width = 200;
- break;
- case 2:
- cell.Width = 30;
- break;
- case 3:
- cell.Width = 30;
- break;
- case 4:
- cell.Width = 30;
- break;
- case 5:
- cell.Width = 30;
- break;
- case 6:
- cell.Width = 30;
- break;
- default:
- break;
- }
- */
- /* Loopingnya Bocor Juga
- if (cell.ColumnIndex == 1)
- {
- cell.Width = 20;
- }
- else if (cell.ColumnIndex == 2)
- {
- cell.Width = 100;
- }
- else
- {
- cell.Width = 50;
- }
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement