回复 4楼Hjr2350的帖子
Spread所提供自定义打印预览窗口的接口很有限
设置预览窗口:
fpSpread1.SetPrintPreview(new PrintPreviewDialog());
自定义打印:
- private void button1_Click(object sender, EventArgs e)
- {
- printDocument1.Print();
- }
-
- private void Form1_Load(object sender, EventArgs e)
- {
- fpSpread1.Sheets.Count = 2;
- fpSpread1.Sheets[0].Cells[0, 0].Value = "test";
- fpSpread1.Sheets[1].Cells[0, 0].Value = "test";
- }
- private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
- {
- Rectangle rect;
- rect = new Rectangle(0, 0, 100, 100);
- fpSpread1.OwnerPrintDraw(e.Graphics, rect, 0, 1);
- Rectangle rect1;
- rect1 = new Rectangle(0, 200, 100, 100);
- fpSpread1.OwnerPrintDraw(e.Graphics, rect1, 1, 1);
- }
复制代码 |