怎样设置默认打印机(HttpPrinter 易桥网络打印机)

1.把 报表绑定打印机

2.客户端打印时 指定打印机,

控制面板中 可以查看您的 打印机的名称

下面的 "PrinterName": encodeURIComponent("打印机名称"), 改为

"PrinterName": encodeURIComponent("EPSON LQ-630K ESC/P2")

{
"ReportName": encodeURIComponent("test.grf"), /报表文件名/
"Copies": 1, /可选。打印份数,支持指定打印份数。默认1份,如果为零,不打印,只返回报表生成的pdf,jpg等文件/
"PrinterName": encodeURIComponent("打印机名称"), /可选。指定打印机,为空的话 使用默认打印机, 请在 控制面板 -> 设备和打印机 中查看您的打印机的名称 /
"PrintOffsetX": 0, /可选。打印右偏移,单位厘米。报表的水平方向上的偏移量,向右为正,向左为负。/
"PrintOffsetY": 0, /可选。打印下偏移,单位厘米。 报表的垂直方向上的偏移量,向下为正,向上为负。/
"token": encodeURIComponent("aa"), /*可选。只要token值在列表中 方可打印

  "Control": encodeURIComponent(‘[‘  ///*部件框,可选值:AsStaticBox ,AsMemoBox,AsRichTextBox,AsPictureBox (base64格式),AsBarcode*/
    +‘{"type": "AsStaticBox", "name": "姓名","value": "高文杰","required": false},‘
    +‘{"type": "AsStaticBox", "name": "性别","value": "男","required": false},‘
    +‘{"type": "AsStaticBox", "name": "电话","value": "13165191728","required": false},‘

}



成功返回 {"status":"ok","data":"报表地址"}, 失败返回 {"status":"error","data":"具体的错误信息"}

原文地址:https://blog.51cto.com/7166940/2400119

时间: 2024-08-02 22:19:09

怎样设置默认打印机(HttpPrinter 易桥网络打印机)的相关文章

C#设置默认打印机

开发中经常会遇到需要用到打印机的问题,那么我们现在来一个Demo修改系统默认打印机.先看运行效果吧.(主要为了展示代码和功能,界面就随便拖拉了一个,比较丑,不要介意.) 界面构建非常简单,首先新建一个Form窗体,拉一个comboBox控件和一个Button然后就可以了. 接下来我们看下代码. 首先是加载本地打印机的类LocalPrinter using System; using System.Collections.Generic; using System.Linq; using Syst

Winform 判断打印机是否可用,实现设置默认打印机功能

Winform 判断打印机是否可用,实现设置默认打印机功能 http://www.cnblogs.com/zfanlong1314/p/3878563.html

winform设置默认打印机

/// <summary> /// 设置默认打印机 /// </summary> public class Externs { [DllImport("winspool.drv")] public static extern bool SetDefaultPrinter(String Name); //调用win api将指定名称的打印机设置为默认打印机 } Externs.SetDefaultPrinter("Microsoft Shared Fax

(转)设置默认打印机

type TForm1 = class(TForm) Button1: TButton; ComboBox1: TComboBox; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; {...} procedure TForm1.FormCreate(

C#Winfrom系统打印机调用/设置默认打印机

实现如下效果: 实现方式如下: using System;using System.Drawing.Printing;using System.Runtime.InteropServices;using System.Windows.Forms; namespace PISS.View.CustomControl{ public partial class PrinterConfigMessBox : Form { #region 定义.构造.初始化 [DllImport("winspool.d

C#获取本地打印机列表,并将指定打印机设置为默认打印机

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Med

如何以编程方式打印到在 MFC 中的非默认打印机

http://cache.baiducontent.com/c?m=9f65cb4a8c8507ed4fece763105790245b09c0252bd7a74a2485d315d2390f07506694ea7a7d0d5d83d87f6305ac4957f7b86c65377571eb8f8dd50a8bb485582a9f5631671df65663d50edcba5154cb37e12efeae69f0caf625e7aec5a5de4320c944040a9780fb4d7467&p

C# winForm 修改默认打印机(效果不太好,每次修改都会有一个系统的打印弹窗(win10))

1.界面:1个按钮+1个combobox; 2.开头阴影 using System.Runtime.InteropServices; 3.代码 private void Form1_Load(object sender, EventArgs e) { InitprinterComboBox(); //初始化打印机下拉列表选项 } private void InitprinterComboBox() {// 初始化打印机列表 PrintDocument printDocument = new Pr

C# 默认打印机设置

private void frmBarCode_Load(object sender, EventArgs e) { bindCbox(): } #region 选择打印机 [DllImport("winspool.drv")] public static extern bool SetDefaultPrinter(String Name); //调用win api将指定名称的打印机设置为默认打印机 private static PrintDocument fPrintDocument