日期:2014-05-17 浏览次数:20865 次
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing.Imaging;
using System.Drawing.Printing;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Reporting.WinForms;
namespace RDLCPrinter
{
/// <summary>
/// 通过RDLC向默认打印机输出打印报表
/// </summary>
public class BillPrint:IDisposable
{
/// <summary>
/// 当前打印页号
/// </summary>
static int m_currentPageIndex;
/// <summary>
/// RDCL转换stream一页对应一个stream
/// </summary>
static List<Stream> m_streams;
/// <summary>
/// 把report输出成stream
/// </summary>
/// <param name="report">传入需要Export的report</param>
private void Export(LocalReport report)
{
string deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>EMF</OutputFormat>" +
//" <PageWidth>2in</PageWidth>" +
//" <PageHeight>20in</PageHeight>" +
" <MarginTop>0in</MarginTop>" +
" <MarginLeft>0in</MarginLeft>" +
" <MarginRight>0in</MarginRight>" +