商品资料中每个商品有唯一编号与对应的商品名称,如"20128762 铅笔",要把商品名称与编号打印成标签纸上,商品编号要用条码打印。(原来一直把商品资料导出成Excel,再连接到BarTender打印,没有问题)但现在要求在现有程序中提供一个功能,选中商品后,直接输出到条码打印机打印出来。大家有没有比较成熟的办法,一定要直接通过程序输出打印,你超市打印小票一样,不要有预览界面。环境:.net 1.1/2.0 C#/VB.net

解决方案 »

  1.   

    请真正做过的朋友回答,谢谢!有人推荐我用Active Report,我试用了,但直接打印没反应,有没有用过Report方式直接打印的。
      

  2.   

    這個公司的產品肯定可以http://www.neodynamic.com/DesktopDefault.aspx
      

  3.   

    给页面放一个DropdownList,在PageLoad事件里添加以下代码:
     For Each iprt As String In System.Drawing.Printing.PrinterSettings.InstalledPrinters
                DropDownList1.Items.Add(iprt)
       Next
    放一个Button,点击事件为:
    Dim reportDoc As ReportDocument = New ReportDocument()       reportDoc.Load(Server.MapPath("CrystalReport1.rpt"))
            reportDoc.PrintOptions.PrinterName = DropDownList1.SelectedItem.Text
            reportDoc.PrintToPrinter(1, False, 0, 0)
    在VS2005上测试通过。今天发现一个好的办法,给画面拖一个CrystalReportSource空间CrystalReportSource1,拖一个sqldatasource,在sqldatasource中进行数据筛选,然后将它与CrystalReportSource绑定,执行下边几句进行打印CrystalReportSource1.DataBind(); '取出筛选的数据
    CrystalReportSource1.ReportDocument.PrinterName = DropDownList1.SelectedItem.Text
    CrystalReportSource1.ReportDocument.PrintToPrinter(1, False, 0, 0)
    考虑一下水晶报表,很容易实现直接打印
    打高度关注PrintToPrinter(1, False, 0, 0)
      

  4.   

    用 printdocument 组件 绝对可以实现