Print on previous databand

TurntwoTurntwo Folsom, CA
edited 12:50PM in FastReport .NET
I want to print the text (CONT) on the last databand for a page, but only if there are more records (i.e. the page is going to overflow to a second page) for that group of records. I'm using an object datasource.

I have written the following code:
private void Data2_BeforePrint(object sender, EventArgs e)
{
if ((int)Report.GetVariableValue("Row#")==9)
Report.SetParameterValue("Continued", "(CONT)");
else
Report.SetParameterValue("Continued", String.Empty);

}

(Note, 9 records fit per page).

This works except when there are exactly 9 records in the child databand - then I get a (CONT) printing when I don't want it. Is there any way to check if the second data band has more records or not? Or print the (CONT) on the previous record when there are 10 records?

I tried the following in conjunction with the if statement above, but it didn't work either:
Report.GetDataSource("Bills.BillCharges").HasMoreRows

Thanks,

Jason

Comments

  • edited 12:50PM
    Hi,

    Prepare your report,

    Then
    a = Report.Engine.TotalPages;
    b = Report.Engine.PageNo;

    if b< a then
    print "Continued"
  • edited 12:50PM
    Hello,

    You may do the following:
    - add a footer to your data band (or, use a group footer if the databand has a group);
    - set the footer's RepeatOnEveryPage property to true;
    - put the text object with "Continued" text on the footer;
    - set the text object's PrintOn property to "RepeatedBand".
  • TurntwoTurntwo Folsom, CA
    edited 12:50PM
    Worked beautifully - thanks. And no script code needed, even better.
    AlexTZ wrote: »
    Hello,

    You may do the following:
    - add a footer to your data band (or, use a group footer if the databand has a group);
    - set the footer's RepeatOnEveryPage property to true;
    - put the text object with "Continued" text on the footer;
    - set the text object's PrintOn property to "RepeatedBand".

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.