Page 2 of 2

Receipt printers and endless paper reel

Posted: Tue Dec 08, 2009 10:30 am
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.

Re: Receipt printers and endless paper reel

Posted: Thu Apr 10, 2014 5:22 am
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

Re: Receipt printers and endless paper reel

Posted: Thu Apr 10, 2014 5:47 am
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.

Re: Receipt printers and endless paper reel

Posted: Fri Mar 03, 2017 11:37 pm
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.

Re: Receipt printers and endless paper reel

Posted: Tue Mar 07, 2017 8:58 am
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.

Re: Receipt printers and endless paper reel

Posted: Mon Mar 13, 2017 6:17 pm
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;
}

Re: Receipt printers and endless paper reel

Posted: Tue Mar 14, 2017 6:35 pm
by Alex K.
Hello,

Thank you for your solution.