• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to repeat table header on each page of PDF using Coldfusion

New Here ,
Jul 31, 2009 Jul 31, 2009

Copy link to clipboard

Copied

Hi all,

Can anybody help me in resolving this issue. The details are mentioned below.

I am generating PDF using <cfdocument> tag of Cold Fusion.
I have a header and footer to be displayed on each page. I am rendering data in a table.
If rows in the table exceed a page , and continue on the next page , I want the table headers to be repeated on each of the page.

Example :

Currently this is happening:

Page Header

Sr No

Name

Occupation

1

A

A

2

B

B

3

C

C

Page Footer : Page No 1

Page Header

4

A

A

5

B

B

6

C

C

Page Footer : Page No 2

--------------------------------------------------------------------------------------------------------------------------------------------------------

What I want is :

Page Header

Sr No

Name

Occupation

1

A

A

2

B

B

3

C

C

Page Footer : Page No 1

Page header

Sr No

Name

Occupation

4

A

A

5

B

B

6

C

C

Page Footer : Page No 2

TOPICS
Advanced techniques

Views

5.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 31, 2009 Jul 31, 2009

Copy link to clipboard

Copied

Make the table headers part of the page header.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 31, 2009 Jul 31, 2009

Copy link to clipboard

Copied

Hi Dan ,

Thanks for your inputs.

This way wont work beacause , am displaying other text and table both, and the table will be diplayed based on some conditions. If the conditions are true , table will be diplayed , else not.

I missed to illustrate text in the example. The scenario is something like this :

Page Header

Text .........

Table [Displayed conditionaly]

Page Footer

Please suggest me some way to do this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 07, 2009 Aug 07, 2009

Copy link to clipboard

Copied

I think this should work

       <cfdocumentitem type="header">
           <cfoutput>Header #ctr#</cfoutput>
       </cfdocumentitem>
       <cfdocumentitem type="footer">
           <cfoutput>Footer #ctr#</cfoutput>
       </cfdocumentitem>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 03, 2012 Apr 03, 2012

Copy link to clipboard

Copied

I have been having this same problem too. have tried several workarounds to do this, whats worse is that i have to get it to work in Google Chrome. Any help is greatly appreciated.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 22, 2022 Sep 22, 2022

Copy link to clipboard

Copied

LATEST

@Renu_Deshpande we acheive this by using simple css 

table { -fs-table-paginate: paginate !important; }

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation