• 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 print multiple PDF reports from a table of records in one push?

New Here ,
Sep 06, 2008 Sep 06, 2008

Copy link to clipboard

Copied

I'm using CFDocument to create PDF reports based on records in a table. I have this set up now to run one at a time. What I would like to do is two-fold:

1) Have the report print automatically without intervention from the user

2) Print for all the records in the query.

I've tried a combination of cfloop and others but just can't get this to run right. Can comebody give me some guidance on this? I created this great report but I need to run it for the backlog of records and doing 200 of them one at a time is not so appealing.

Thanks for the help!
TOPICS
Advanced techniques

Views

427

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 ,
Sep 07, 2008 Sep 07, 2008

Copy link to clipboard

Copied

The 2nd question is pretty straightforward, somewhere you use cfoutput.

Printing automatically is a bit more involved. You need the printer in question to be installed on your server. Then you need to run cfexeucte to print the job. What you execute depends on the OS of your server.

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 11, 2008 Sep 11, 2008

Copy link to clipboard

Copied

I'm not sure that the second question is straightforward. I have tried CFOUTPUT, but you can't nest CFDocuments within a cfoutput statement. My thought is the only way to do this is to call a separate cfc.

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
LEGEND ,
Sep 11, 2008 Sep 11, 2008

Copy link to clipboard

Copied

The original question had to do with creating PDF reports based on records in a table. That's pretty straightforward.

What's all this about nesting CFDocuments?

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
Contributor ,
Sep 11, 2008 Sep 11, 2008

Copy link to clipboard

Copied

I use cfdocument to print out personnel biographies. You select a user, click print, and bam, a .pdf is generated (sometimes they are 2 or 3 pages long, depending upon the content in their sql record). What I need to do is allow a user to pick a few biographies, and click print and generate one pdf with multiple biographies. The problem I have is dealing with page numbering. I need the page numbering to be based on ther person and not the overall file. (If a person's bio is two pages, I need to print "continued" on their second page. The problem I have is that EVERY person after page one is essentially not the first page, so they all get the continue message.

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
LEGEND ,
Sep 11, 2008 Sep 11, 2008

Copy link to clipboard

Copied

LATEST

What you probably need to do is generate each bio individually with the
<cfdocument...> tag just the way you want them. And then use some of
the advanced <cfpdf...> functionality that allows you to append two or
more individual PDF's into a single large PDF.

Here are some resources that describe some of the <cfpdf...> functionality.

http://www.coldfusionjedi.com/index.cfm/2007/7/9/ColdFusion-8-Working-with-PDFs-Part-1
http://www.coldfusionjedi.com/index.cfm/2007/7/10/ColdFusion-8-Working-with-PDFs-Part-2
http://cfpdf.blogspot.com/
http://cfpdf.blogspot.com/2007/06/cfpdf-action-merge_27.html
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=cfpdf_02.html

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