Page Size on Receipt Printer

I'm printing to a receipt printer. ...It seems that I need to set the page size and I can't find a way to make it dynamic. Does anybody know how to do this?

So, if the page is set to 10" height and there is only 1 line in the databand, then I have a ton of white space before the footer prints....to make up the 10"....

Any help would be appreciated.

Comments

  • edited 4:11PM
    Hello,

    The solution is to set the paper height dynamically in the script. See the attached report, it can be run from Demo.exe.
  • edited 4:11PM
    AlexTZ wrote: »
    Hello,

    The solution is to set the paper height dynamically in the script. See the attached report, it can be run from Demo.exe.

    Thanks for this....I think it will get me on the right path, however....it seems that in your code, reportHeight, isn't holding a value. I made sure the event afterlayout is called....but when the code:
    private void Page1_StartPage(object sender, EventArgs e)
    {
    if (Engine.FinalPass)
    {
    Page1.PaperHeight = (reportHeight + PageFooter1.Height + 1) / Units.Inches +
    Page1.TopMargin + Page1.BottomMargin;
    }
    }

    is called, it seems that reportHeight doesn't have a value. I've tried even creating another sub specific to the Data1 after layout event...and still it doesn't have a value.

    Any thoughts?
  • edited 4:11PM
    AlexTZ wrote: »
    Hello,

    The solution is to set the paper height dynamically in the script. See the attached report, it can be run from Demo.exe.

    I decided to also upload my report file....you won't have the datasource, but maybe you can see something I don't.

    Thanks,
    Craig
  • edited 4:11PM
    AlexTZ wrote: »
    Hello,

    The solution is to set the paper height dynamically in the script. See the attached report, it can be run from Demo.exe.

    Have you had a chance to look at this?

    Thanks,
    Craig
  • edited 4:11PM
    Hello,

    You should attach the Data2.AfterLayout event to the ReportTitle1_AfterLayout handler. Also correct the code:
        private void ReportTitle1_AfterLayout(object sender, EventArgs e)
        {
          reportHeight += (sender as BandBase).Height;
        }
    
        private void Page1_StartPage(object sender, EventArgs e)
        {
          if (Engine.FinalPass)
          {                                                                           
            Page1.PaperHeight = (reportHeight + PageFooter1.Height +1) / Units.Millimeters   +
              Page1.TopMargin + Page1.BottomMargin;
          }
        }
    
    (the page.PaperWidth and PaperHeight are always measured in millimeters).
  • edited 4:11PM
    AlexTZ wrote: »
    Hello,

    You should attach the Data2.AfterLayout event to the ReportTitle1_AfterLayout handler. Also correct the code:
        private void ReportTitle1_AfterLayout(object sender, EventArgs e)
        {
          reportHeight += (sender as BandBase).Height;
        }
    
        private void Page1_StartPage(object sender, EventArgs e)
        {
          if (Engine.FinalPass)
          {                                                                           
            Page1.PaperHeight = (reportHeight + PageFooter1.Height +1) / Units.Millimeters   +
              Page1.TopMargin + Page1.BottomMargin;
          }
        }
    
    (the page.PaperWidth and PaperHeight are always measured in millimeters).


    I'm so mad! I spent 30+ hours on this and these few changes did it...sometimes it's the minor changes! Thanks again!!! Looks like everything is working now!
  • How can I increase the description automatically increase the height of the report?



Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.