This is a migrated thread and some comments may be shown as answers.

Print at a fixed position from bottom of page

6 Answers 751 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mahipal
Top achievements
Rank 1
Mahipal asked on 05 Nov 2009, 01:45 AM
Hi, I am creating an invoice report that has a payment slip at the bottom of the report. The payment slip contains the Amount Due and the Address to mail in the payment. Customers detach the payment slip along the dotted line and send it along with their payment. The address on the payment slip should always show up through the envelope window. This can only happen when the payment slip always prints at a fixed distance from the bottom of the page. I've tried using a panel (that docks to the bottom of the page etc.) without any luck.

Can you please provide me some tips on how I can do this?

Thanks
Mahipal

6 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 05 Nov 2009, 10:33 AM
Hello Mahipal,

In the current version of Telerik Reporting, the detail section would not stretch to the bottom of the page but would end depending on the data that is shown in current page. The only "fixed" sections in the report are the page section (Page Header and Footer) so you can place the payment slip info in the page footer section.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mahipal
Top achievements
Rank 1
answered on 05 Nov 2009, 03:10 PM
OK, but from what I read from the documentation, Page Header and Page Footer cannot contain data bound fields. How can I add data bound fields to the page footer?

Atleast anything that I can atleast do programmitically to make it work?

Thanks
0
Steve
Telerik team
answered on 05 Nov 2009, 03:37 PM
Hello Mahipal,

Page sections are not related to the report itself, but are relative to the margins of the report's media, i.e. to the paper or screen. Usually page headers and footers are placed in the margins and contain page numbers, document dates, etc. and that is the reason why we have such information in the documentation. Nevertheless we've allowed databound items in the page sections and of course you can always pass the value from another section as shown in this KB article: Using data source fields in Page Sections.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mahipal
Top achievements
Rank 1
answered on 05 Nov 2009, 06:37 PM
Actually, its not doing what I want. I'm printing a whole bunch of invoices as a batch in just one report. Each invoice has payment slip at the bottom of the page. So if I grab the value from the report footer and put it in my page footer, it will always put the data that belongs to the last invoice. I need it to grab the data for each invoice and put it in its corresponding page footer.

I have tried something like.

1. I have added a databound to the details section.
2. I have added a text field (not databound) to the page footer section.
3. In my Page Footer ItemDataBound Event handler, I tried to get the databound field value from the details section and assign it to the text field in the page footer. But this doesn't work. The Find method doesn't find any items that match the databound field name in the details section. The "rBase" object below returns 0 items.

Please tell me a way to accomplish what I want... Thanks

 

private void pageFooterSection1_ItemDataBound(object sender, EventArgs e)

 

{

Telerik.Reporting.Processing.

PageSection processingPageFooter =

 

(Telerik.Reporting.Processing.

PageSection)sender;

 

Telerik.Reporting.Processing.

Report processingReport = processingPageFooter.Report;

 

Telerik.Reporting.Processing.

ReportItemBase[] rBase = processingReport.Items.Find("textBox48", true);

 

 

string val = string.Empty;

 

 

for (int i = 0; i < rBase.Length; i++)

 

{

Telerik.Reporting.Processing.

TextBox txt = (Telerik.Reporting.Processing.TextBox)rBase[i];

 

val = val +

";" + txt.Text;

 

}

}

 
0
Steve
Telerik team
answered on 09 Nov 2009, 05:38 PM
Hi Mahipal,

The KB from previous post uses obsolete code which we're going to update. The correct code according to the updated API (which you should have received as warning when compiling) is:

Telerik.Reporting.Processing.TextBox rBase = (Telerik.Reporting.Processing.TextBox)processingReport.ChildElements.Find("textBox48", true)[0];

Anyway it is expected that the pageFooter would contain the data from the last record only as Page Sections are processed by the respective rendering engine, which is after the report has been data-bound, so it contains info about the last record only. In this line of thoughts you can process the invoices one by one for each corresponding record (as normally an invoice is unique per customer) and if you need this into one main report, then combine them into a report book or use 3rd party software to combine their exported counterpart (such as word, pdf etc.).

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Samson
Top achievements
Rank 1
answered on 15 Mar 2018, 05:36 AM

I do have the same issue. I am also trying to print the pay slip.

Keeping this section on the page footer wont work as a single statement will have more pages. if we keep this in the page footer this will get printed on all pages.

In telerik we have option only to disable this print on first and last page.

 

Any other options?

Tags
General Discussions
Asked by
Mahipal
Top achievements
Rank 1
Answers by
Steve
Telerik team
Mahipal
Top achievements
Rank 1
Samson
Top achievements
Rank 1
Share this question
or