DataTable dt =
SheetView fpspread = fpSpread1.ActiveSheet;
using (FpSpreadBinder fpSpread = new FpSpreadBinder(spCost))
{
spread.AddColumns("구분", "COSTTYPE", 0, "Center", "Center");
spread.AddColumns("결제방법", "PAYMETHOD", 0, "Center", "Center");
spread.AddColumnsNumber("단가", "COST", 0, "#,###", "Center", "Right");
spread.AddColumnsNumber("수량", "QTY", 0, "#,###", "Center", "Right");
spread.AddColumnsNumber("금액", "MNY", 0, "#,###", "Center", "Right");
spread.AddColumns("비고", "REMARK", 0, "Center", "Center");
fpSpread.DataSource = dt;
fpSpread.DataBind();
}
FarPoint.Win.Spread.SheetView spread = spCost.ActiveSheet;
spread.RowCount = 8;
spread.SetText(1, 1, "1234");
spread.Columns.Get(1).Label = "구분";
Object[] rowData = new Object[] { "Shorter", "4.12", "4.12" };
spread.Rows.Add(rowData);
SheetView svCost= spCost.ActiveSheet;
foreach (Row r in svCost.Rows) //spread Row
{
DataRow dr = tripDetailDt.NewRow(); //dataRow
foreach (Column c in svCost.Columns) //spread Column
{
dr[c.DataField] = svCost.GetText(r.Index, c.Index);
// dataRow[columnName] = spread(row, col).Text
}
tripDetailDt.Rows.Add(dr);
}
tripDetailDs.Tables.Add(tripDetailDt)
;
SheetView svEmp = spEmp.ActiveSheet;
foreach (Row r in svEmp.Rows)
{
DataRow dr = empDt.NewRow();
foreach (Column c in svEmp.Columns)
{
dr[c.DataField] = svEmp.GetText(r.Index, c.Index);
}
empDt.Rows.Add(dr);
}
empDs.Tables.Add(empDt);
//아래 한줄이면 끝
DataTable dt = spCost.ActiveSheet.GetDataView(true).ToTable();
'IT > 타이탄의 도구' 카테고리의 다른 글
Install - Windows Service (0) | 2020.10.24 |
---|---|
Excel -> PDF 변환 메일 발송 (0) | 2020.07.29 |
한국전력 Open API 실시간 전력량 (0) | 2020.07.10 |
Stream (0) | 2020.06.02 |
Clean architecture (0) | 2020.06.02 |