protected void Page_Load(object sender, EventArgs e)
{
InitializeComponent();
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.creator1 = new Creator(this.components);
}
protected void ButtonCreate_Click(object sender, EventArgs e)
{
creator1.CreateBook(fileName, 1, xlsxVersion.ver2013);
creator1.DefaultFontName = "メイリオ"; creator1.DefaultFontPoint = 10; creator1.SheetName = "商品売上明細書"; creator1.Cell("1").RowHeight = 30;
creator1.Cell("2").RowHeight = 15;
creator1.Cell("3").RowHeight = 18;
creator1.Cell("4:12").RowHeight = 15;
creator1.Cell("A").ColWidth = 1.88;
creator1.Cell("B:R").ColWidth = 3.13;
creator1.Cell("S").ColWidth = 1.88;
creator1.Cell("B1").Value = "商品売上明細書";
creator1.Cell("B1:R1").Attr.MergeCells = true;
creator1.Cell("B1").Attr.FontPoint = 18;
creator1.Cell("B1").Attr.FontStyle = AdvanceSoftware.ExcelCreator.FontStyle.Bold;
creator1.Cell("B1").Attr.HorizontalAlignment = HorizontalAlignment.Center;
creator1.Cell("B1").Attr.FontColor2 = xlColor.White;
creator1.Cell("B1").Attr.BackColor = Color.FromArgb(91, 155, 213);
creator1.Cell("B3").Value = "商品名";
creator1.Cell("B3:G3").Attr.MergeCells = true;
creator1.Cell("H3").Value = "数量";
creator1.Cell("H3:J3").Attr.MergeCells = true;
creator1.Cell("K3").Value = "単価";
creator1.Cell("K3:N3").Attr.MergeCells = true;
creator1.Cell("O3").Value = "金額";
creator1.Cell("O3:R3").Attr.MergeCells = true;
creator1.Cell("B3:R3").Attr.HorizontalAlignment = HorizontalAlignment.Center;
creator1.Cell("B3:R3").Attr.FontColor2 = xlColor.White;
creator1.Cell("B4:G4").Attr.MergeCells = true;
creator1.Cell("H4:J4").Attr.MergeCells = true;
creator1.Cell("K4:N4").Attr.MergeCells = true;
creator1.Cell("O4:R4").Attr.MergeCells = true;
for (int i = 0; i < 5; i++)
{
creator1.RowCopy(3, 4 + i);
}
creator1.Cell("B3:R3").Attr.BackColor = Color.FromArgb(91, 155, 213);
creator1.Cell("B3:R9").Attr.Box(BoxType.Ltc, BorderStyle.Thin, Color.FromArgb(91, 155, 213));
creator1.Cell("B3:R9").Attr.Box(BoxType.Box, BorderStyle.Medium, Color.FromArgb(91, 155, 213));
creator1.Cell("B4").Value = "ExcelCreator 2016";
creator1.Cell("H4").Value = 10;
creator1.Cell("K4").Value = 64000;
creator1.Cell("O4").Func("=H4*K4", null);
creator1.Cell("B5").Value = "VB-Report 8";
creator1.Cell("H5").Value = 8;
creator1.Cell("K5").Value = 85000;
creator1.Cell("O5").Func("=H5*K5", null);
creator1.Cell("B6").Value = "ExcelWebForm";
creator1.Cell("H6").Value = 5;
creator1.Cell("K6").Value = 70000;
creator1.Cell("O6").Func("=H6*K6", null);
creator1.Cell("K4:N9").Attr.Format = "#,##0_ ";
creator1.Cell("O4:R9").Attr.Format = @"¥#,##0;[赤]\#,##0";
creator1.Cell("B4:R4").Attr.LineBottom(BorderStyle.Dotted, Color.FromArgb(91, 155, 213));
creator1.Cell("B5:R5").Attr.LineTop(BorderStyle.Dotted, Color.FromArgb(91, 155, 213));
creator1.Cell("B5:R5").Attr.LineBottom(BorderStyle.Dotted, Color.FromArgb(91, 155, 213));
creator1.Cell("B6:R6").Attr.LineTop(BorderStyle.Dotted, Color.FromArgb(91, 155, 213));
creator1.Cell("B6:R6").Attr.LineBottom(BorderStyle.Dotted, Color.FromArgb(91, 155, 213));
creator1.Cell("B7:R7").Attr.LineTop(BorderStyle.Dotted, Color.FromArgb(91, 155, 213));
creator1.Cell("B7:R7").Attr.LineBottom(BorderStyle.Dotted, Color.FromArgb(91, 155, 213));
creator1.Cell("B8:R8").Attr.LineTop(BorderStyle.Dotted, Color.FromArgb(91, 155, 213));
creator1.Cell("B8:R8").Attr.LineBottom(BorderStyle.Dotted, Color.FromArgb(91, 155, 213));
creator1.Cell("B9:R9").Attr.LineTop(BorderStyle.Dotted, Color.FromArgb(91, 155, 213));
creator1.Cell("B5:R5").Attr.BackColor = Color.FromArgb(221, 235, 247);
creator1.Cell("B7:R7").Attr.BackColor = Color.FromArgb(221, 235, 247);
creator1.Cell("B9:R9").Attr.BackColor = Color.FromArgb(221, 235, 247);
creator1.Cell("K10:N10").Attr.MergeCells = true;
creator1.Cell("K10:N10").Attr.HorizontalAlignment = HorizontalAlignment.Center;
creator1.Cell("K10:N10").Attr.FontColor2 = xlColor.White;
creator1.Cell("K10:N10").Attr.BackColor = Color.FromArgb(91, 155, 213);
creator1.Cell("O10:R10").Attr.MergeCells = true;
creator1.Cell("O10:R10").Attr.Format = @"¥#,##0;[赤]\#,##0";
creator1.Cell("K10:R10").Attr.Box(BoxType.Ltc, BorderStyle.Thin, Color.FromArgb(91, 155, 213));
creator1.Cell("K10:R10").Attr.Box(BoxType.Box, BorderStyle.Medium, Color.FromArgb(91, 155, 213));
for (int i = 0; i < 2; i++)
{
creator1.RowCopy(9, 10 + i);
}
creator1.Cell("K10").Value = "小計";
creator1.Cell("O10").Func("=SUM(O4:R8)", null);
creator1.Cell("K11").Value = "消費税";
creator1.Cell("O11").Func("=O10*0.08", null);
creator1.Cell("K12").Value = "合計";
creator1.Cell("O12").Func("=O10+O11", null);
creator1.CloseBook(true);
}