将报告打印到dotmatrix打印机

时间:2011-08-10 10:48:15

标签: c#

我想在点阵打印机上打印我的Crystal Report。我的报告实际上是一个条形码,虽然很短但打印机在打印一张纸币后会跳过整个A4页面。我希望打印机在打印后停止,然后从停止的位置开始打印下一个帐单。

示例代码:

bill = @"D:\Print\" + "Bill.xls ";
int RowsCount = ws.UsedRange.Cells.Rows.Count;
range = ws.get_Range("A" + RowsCount, "I" + 6);
font = range.Font;
font.Size = 12;
font.Color = Color.Black;
ws.PageSetup.Draft = true;
ws.PageSetup.FitToPagesWide = 1;
ws.PageSetup.FitToPagesWide = 1;
ws.PageSetup.Zoom = 60;
ws.PageSetup.Orientation = Excel.XlPageOrientation.xlPortrait;
ws.get_Range("A" + RowsCount, "I" + 6).PageBreak = (int)Excel.Constants.xlManual;
ws.HPageBreaks.Add(ws.get_Range("A" + RowsCount, "I" + 6));
ws.PrintOutEx();

0 个答案:

没有答案