Receipt printers and endless paper reel

Stimulsoft Reports.NET discussion
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Receipt printers and endless paper reel

Post by Edward »

Hi

Just to summarize all the thoughts mentioned above:

Assume that the report template has only one page in the Designer.

So to print the report on reel paper you need to specify the papersource, paperkind, and page size

report.Pages[0].PaperSize = System.Drawing.Printing.PaperKind.Custom;
report.Pages[0].PaperSourceFirstPage = System.Drawing.Printing.PaperSourceKind.Custom;
report.Pages[0].PaperSourceOtherPages = System.Drawing.Printing.PaperSourceKind.Custom;

report.Pages[0].Height = your height of one page;
report.Pages[0].Width = your width of one page;

report.Render();
report.Print();

But there is no one universal rule for all printers, for example let's take a simple printer Canon Pixma-4600:

PaperSourceKind for this printer contains five different values. One from them is 'Automatic' and others are Custom.

So the settings of the printer contain PapersSource structure and only inner part of that structure has a PaperSourceKind type.
So not always possible to specify a PaperSource parameter of the Page in the report explicitly.

In such cases all we can do is to use a PrintDialog standard windows dialogue for setting of the printer parameters.

We constantly receive Emails from our customers with confirmation of the fact that some printer drivers require specifying in their properties of exactly the same format name from their inner list. If the paper format was not from the printer's inner list then the default format will be used instead. And the same situation with a PaperSource parameter.
Sometimes if a PaperKind was set correctly, but the PaperSource was not set properly, all print settings could be reset in their default value.

Thank you.
onlylion
Posts: 1
Joined: Thu Apr 10, 2014 5:19 am

Re: Receipt printers and endless paper reel

Post by onlylion »

Hi,

How could I do the same thing for an excel spreadsheet i have, I dont wish for it to consider page breaks.

Thank you

Deon
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Receipt printers and endless paper reel

Post by HighAley »

Hello, Deon.
onlylion wrote:How could I do the same thing for an excel spreadsheet i have, I dont wish for it to consider page breaks.
Could you describe your issue more detailed.
Which our component do you use?
Which version?
How do you export report?

Thank you.
ToolHound
Posts: 4
Joined: Fri Feb 13, 2009 6:27 pm
Location: Canada

Re: Receipt printers and endless paper reel

Post by ToolHound »

Back on this subject again after 8 years.

Still having problems printing to Epson TV88IV receipt printer. Cuts off after 12 1/8 inches no matter where it is in the report generation. Could be in the detail, the footer or wherever 12 1/8" happen to be. Shorter reports work properly.

Have set the PaperSize, PaperSourceFirstPage and PaperSourceOtherPages to custom. PageWidth to 80 and PageHeight to 32000.

Help. Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Receipt printers and endless paper reel

Post by Alex K. »

Hello,

Please try to check the printer settings.
In the printer settings, there is the maximum length of paper to trim.

Thank you.
renathucazari
Posts: 15
Joined: Fri Jan 20, 2012 9:06 am
Location: Brasil

Re: Receipt printers and endless paper reel

Post by renathucazari »

You can dynamically set the height of the page, depending on the amount of data on a page.

First set the page size to Custom, then write the following script in the EndRender event of report:

Code: Select all

foreach (StiPage page in this.RenderedPages)
{
    double max = 0;
    foreach (StiComponent comp in page.GetComponents())
    {
        if (comp.Bottom > max) max = comp.Bottom;
    }
    page.PageHeight = max + page.Margins.Top + page.Margins.Bottom;
}
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Receipt printers and endless paper reel

Post by Alex K. »

Hello,

Thank you for your solution.
Post Reply