Skip to content
Report-Designer

Printing straight to users' PCs

Send a report to a print queue and let the Windows print agent collect it.

Queue a report

Call PrintAsync on a ReportServerClient. The queue usually matches the PC name. This example sends the app’s voucher rows and the named lines data set. The server renders pages at 300 dpi with the report and project print offsets and holds the job for the agent.

var data = ReportData.FromObjects(vouchers).With("lines", lines);
var jobId = await server.PrintAsync("check-voucher", data, parameters: null, queue: "ACCT-PC-01", copies: 2);
var job = await server.GetPrintJobAsync(jobId);

Over HTTP, send POST /api/projects/{project}/reports/{report}/print?queue=ACCT-PC-01&copies=2 with the same body as a render request. Use the job ID to check whether the job is queued, printing, done or failed. The audit log records the queue. Copies are limited to 100.

Set up the print agent

Install the agent on the PC that will do the printing. Configure ServerUrl, ApiKey and Queue. On the server, add "PrintQueues": ["ACCT-PC-01"] to the agent’s entry in ApiKeys. Use "*" in the list to allow all queues.

The agent starts at Windows logon and prints without a dialog. It uses the printer named in the job if that printer is available, then its configured Printer, then the Windows default. The notification-area icon shows the last job and lets the user pause printing or exit. The agent reads installer settings from the registry and can also read %ProgramData%\Report-Designer\print-agent.json.

Set OffsetXMm and OffsetYMm for the printer when aligning pre-printed forms. Set PrintToFolder to save each job as a PDF using Microsoft Print to PDF. The agent log is at %LocalAppData%\Report-Designer\print-agent.log.

By default, unclaimed jobs expire after 24 hours and finished jobs remain available for status checks for 168 hours. If an agent stops during printing, the server offers the job again after 10 minutes.