Print on previous databand
Turntwo
Folsom, CA
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
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
Prepare your report,
Then
a = Report.Engine.TotalPages;
b = Report.Engine.PageNo;
if b< a then
print "Continued"
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".