Unlimited Paper Height in .Net

So far Fastreport does nicely whatever we needed. However, I'm stuck with paper height setting (through VB code) for continous printing paper sources.
Understood, its not available as an option in .Net but it is available in FR 4.0 Studio. Since, its a windows form application developed using VB.Net, it could be simpler if some work around can be available using code.

Any help is highly appreciated.

Comments

  • edited 8:03AM
    Hello,

    We plan to add such property in one of the next major builds. Now you may use the report script to set the page height. Make your report two-pass. Use the script to calculate the report height on the first pass, and set the page height on the final pass.

    See the attached report.
  • edited 8:03AM
    AlexTZ wrote: »
    Hello,

    We plan to add such property in one of the next major builds. Now you may use the report script to set the page height. Make your report two-pass. Use the script to calculate the report height on the first pass, and set the page height on the final pass.

    See the attached report.


    Alex rocks !!! Works wonderfuly. Thank mate.
  • edited 8:03AM
    Hi,

    Sorry I am new to Fast Reports.net.

    I recreated a report on the basis of your report. But each record prints on 1 page.

    How to create a report with two-pass ?

    P.S. I want to change the height of the page based on the number of records. All records should be printed in a single page.

    Thanks in advance.
  • edited May 2010
    Hello,

    You probably forgot to connect BeforePrint event handlers to the bands. You may attach your report here for review.
  • edited 8:03AM
    wrote:
    You probably forgot to connect BeforePrint event handlers to the bands.

    What code should I handle within the BeforePrint event handlers of the bands?

    I created a simple report using the report wizard and connecting to the Northwind access database employees table.

    I selected three columns ID, FirstName and LastName.

    I did nothing else except adding code from your example.

    Am I missing something ?

    Please advise.

    Thanks in advance.
  • edited 8:03AM
    Your code is not connected to object's events.
    http://fast-report.com/documentation/UserM...enthandlers.htm
  • edited 8:03AM
    Hai,

    I have worked around the problem. Please reply is there any other way of doing this.


    1. I have created two reports billbase, billPrint.
    2. In billbase, I created a public method called GetRows in which I pass the number of rows counted from Data_event.
    3. I prepare the report and get the number of rows from the report.

    4. In billPrint I created a public method called SetRows in which I pass the number of rows.
    5. In the Page1_StartPage event I multiply the number of rows with the databand height and add the report header, footer heights.
    6. Then I print the report.

    The report prints correctly as intended.

    Am I doing this the right way or is there an easier way of doing this.

    Thanks in advance.
  • edited 8:03AM
    Hello,

    Not the good way. Will not work if the databand has CanGrow/CanShrink options. Why you don't use the example I've posted in this topic?
  • edited 8:03AM
    Hai Alex,

    I finally made it to work as expected with a slight modification in your code.

    I made a report with double pass and added the following code.

    wrote:
    private float reportHeight;

    private void Data1_AfterPrint(object sender, EventArgs e)
    {
    reportHeight += (sender as BandBase).Height;
    }

    private void Page1_StartPage(object sender, EventArgs e)
    {
    if(Engine.FinalPass)
    {
    Page1.PaperHeight = (reportHeight + ReportTitle1.Height + PageHeader1.Height +
    PageFooter1.Height)/Units.Millimeters + Page1.TopMargin +
    Page1.BottomMargin;
    }
    }

    Please inform me - is my code correct.

  • edited 8:03AM
    Hello,

    Yes, it's correct.
  • edited 8:03AM
    Thank you for your patience and advice Alex.
  • edited June 2015
    Hi,

    I am having trouble doing this with my report as it already contains quite a lot of code. Page1.height seems to be doing nothing in my case and is defaulting to the 'page.height' specified in the property.

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.