You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.5 KiB
C#
61 lines
2.5 KiB
C#
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing.Printing;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using TradeModel;
|
|
|
|
namespace TradeManage.HuoWu
|
|
{
|
|
public partial class HW_GoodsPrint : System.Web.UI.Page
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
protected void APrint_Click(object sender, EventArgs e)
|
|
{
|
|
//List<GoodWarePrint> gwplist = new List<GoodWarePrint>();
|
|
//if (Session["GoodWarePrint"] != null)
|
|
// gwplist = (List<GoodWarePrint>)Session["GoodWarePrint"];
|
|
|
|
//ReportDocument rptSales = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
|
|
//rptSales.FileName = Server.MapPath("../PrintTemplate/GoodBatch.rpt");
|
|
//rptSales.SetDataSource(gwplist);
|
|
//PrintDocument prtdoc = new PrintDocument();
|
|
//string strDefaultPrinter = prtdoc.PrinterSettings.PrinterName;
|
|
|
|
//// then print, this is the important thing here
|
|
//rptSales.PrintOptions.PrinterName = strDefaultPrinter;
|
|
//rptSales.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.DefaultPaperSize;
|
|
//rptSales.PrintOptions.PaperSource = CrystalDecisions.Shared.PaperSource.Auto;
|
|
|
|
////parameters here depending on your situation.
|
|
//rptSales.PrintToPrinter(1, true, 1, 9999);
|
|
}
|
|
public void ZPrint(List<GoodWarePrint> gwplist)
|
|
{
|
|
////List<GoodWarePrint> gwplist = new List<GoodWarePrint>();
|
|
//if (Session["GoodWarePrint"] != null)
|
|
// gwplist = (List<GoodWarePrint>)Session["GoodWarePrint"];
|
|
|
|
//ReportDocument rptSales = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
|
|
//rptSales.FileName = Server.MapPath("../PrintTemplate/GoodBatch.rpt");
|
|
//rptSales.SetDataSource(gwplist);
|
|
//PrintDocument prtdoc = new PrintDocument();
|
|
//string strDefaultPrinter = prtdoc.PrinterSettings.PrinterName;
|
|
|
|
//// then print, this is the important thing here
|
|
//rptSales.PrintOptions.PrinterName = strDefaultPrinter;
|
|
//rptSales.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.DefaultPaperSize;
|
|
//rptSales.PrintOptions.PaperSource = CrystalDecisions.Shared.PaperSource.Auto;
|
|
|
|
////parameters here depending on your situation.
|
|
//rptSales.PrintToPrinter(1, true, 1, 9999);
|
|
}
|
|
}
|
|
} |