Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to print multiple pages generated dynamically all at once 1

Status
Not open for further replies.

196509

IS-IT--Management
Sep 4, 2001
7
0
0
US
Hi all,
I have a user home page generated per user profile(user=1) that was chosed from previous page. This user home page lists links to related pages of this user(so it lists user=1&pagetype=1, user=1&pagetype=2, user=1&pagetype=3, user=1&pagetype=4 pages). I need to add "print" function on the user home page that prints all these related pages in the list at once without having the user to click on each link, bring up the page on the brower, then click on "print" from browser menu to print them individually.
I understand that all those pages need to be sent on a screen first, then &quot;print&quot; of browser menu can be used. How do I <u>take the dynamically generated list of pages and display their content on a screen, so they all can be printed by clicking &quot;print&quot; only once</u>? Or is there a better way to approach this? Thanks so much.

 
o your sol : &quot;take the dynamically generated list of pages and display their content on a screen&quot; it's easy : just include user=1&pagetype=1, user=1&pagetype=2, user=1&pagetype=3, user=1&pagetype=4 in a dynamically generated page (linked to by a &quot;print&quot; button) !!! and print that page !!
o a more elegant but less obvious sol : use the @media tag from css
 
Hi iza,
Thanks for your message, but could you be more specific for me? How do you mean to include user=1&pagetype=1, user=1&pagetype=2, user=1&pagetype=3, user=1&pagetype=4 in a dynamically generated page?

These links are generated dynamically. I will have to carry these links over to the page(linked by the &quot;print&quot; button) behind the scene, and some how get their content displayed so they can be printed.

Also when it's printed, it will be one long page, so I need to have page break between contents of user=1&pagetype=1 and user=1&pagetype=2 pages. So the end result will be printing user=1&pagetype=1, user=1&pagetype=2, user=1&pagetype=3, so on as all seperate pages. Would you have example code to do this?

Sincerely,
 
I found out yesterday, that you can insert pagebreaks from javascript. From IE4+ and NN6 +
Otherwise, you must build a print preview code that will do it.

Yes, you have to carry the links through your screens in some hiddens or in XML structure. In the page that you need to print, regenerate the contents of the dynamic pages and format it, then print it.
 
You can do page breaks using style sheets. Here is an example of how to do it. The example will through a break after each instance of the table is printed.

Hope this can be of some help.

Code:
<CFQUERY NAME=&quot;getDetails&quot; DATASOURCE=&quot;ds&quot;>
	SELECT *
	FROM a
</CFQUERY>
<HTML>
<HEAD>
<STYLE TYPE=&quot;text/css&quot; MEDIA=&quot;screen,print&quot;>
.maintable {
	page-break-after : always;
}
</STYLE>
</HEAD>
<BODY>
<CFOUTPUT QUERY=&quot;getDetails&quot;>
<TABLE CLASS=&quot;maintable&quot;>
...
</TABLE>
</CFOUTPUT>
</BODY>
</HTML>
 
Hi~,
Thanks so much for your input, Janoh, and for the example code, ded!!! The example code is really helpful. Thanks again.
I've got the theory or data flow of what should be happening(in behind the scene) for me to print them all at once. The difficult part is that, being in a very junior level, I'm just not sure what CF sysntaxes should be used. Someone suggested to use CFHTTP and CFFILE, but not sure how I will assemble them all together to make it happen.
still struggling...

Sincerely,
 
including your pages :
<cfinclude ??user=1&pagetype=1 ??>
<cfinclude ??user=1&pagetype=2 ??>
...
creating a break for printing :
they explain it better than i would

sorry i'm in a hurry
have fun with your pages !!
 
Hi again,
I decided to try <cfhttp>.
I have a several links that I want to list their content one after another but with a page break between pages, so I coded like this(for now each links are hard coded to make things simpler):

<cfhttp method=&quot;Get&quot; url=&quot; resolveurl=&quot;yes&quot;>
<cfoutput>#CFHTTP.FileContent#</cfoutput>
<br class=&quot;pagebreak&quot;>
<cfhttp method=&quot;Get&quot; url=&quot; resolveurl=&quot;yes&quot;>
<cfoutput>#CFHTTP.FileContent#</cfoutput>
<br class=&quot;pagebreak&quot;>
<cfhttp method=&quot;Get&quot; url=&quot; resolveurl=&quot;yes&quot;>
<cfoutput>#CFHTTP.FileContent#</cfoutput>

However this results content written over top of another. In other words, page 162 gets displyed first on browser, 163 displayed on top of 162, 164 displayed on top of 163. Does this mean I can't use more than one <cfhttp> to output content of URLs on one page?
Then how could I achieve appending content of one page below another page(with pagebreak between them resulting seperate pages when printed)?
Anyone who could help me, thanks very much!

Regards,
CS.
 
I would give this a try:

Code:
<cfset URL.user = 5>
<cfloop start=&quot;162&quot; end=&quot;164&quot; index=&quot;URL.page&quot;>
  <cfinclude template=&quot;[URL unfurl="true"]http://www.test.com/testpage.cfm&quot;>[/URL]
  <br class=&quot;pagebreak&quot;>
</cfloop>

i am not sure about using index=&quot;URL.page&quot; you may have to use index=&quot;p&quot; and then on the next line do <CFSET URL.page = p>
 

Any idea how to get this to work in Netscape (esp 4.7)?

I can't find anything to do the trick!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top