hefterr
asked on
Print Page Button in ColdFusion
Hi,
I'm sure I'm not the first to ask this so please be patient.
I have a dynamic "Order Detail" page that I would like to have the user be able to print using a PRINT button.
To do this I will need a "printer friendly" version of the page without the header/footer and some graphic border changes.
I can create a separate CF template (for printing) and dynamically build the page again when the PRINT button is hit - BUT there is a small chance that the data could change in between.
How is this done with dynamic pages - to create printer friendly versions without rebuilding the data in CF. Is CFdocument involved?
Thanks in advance (but confused)
hefterr
I'm sure I'm not the first to ask this so please be patient.
I have a dynamic "Order Detail" page that I would like to have the user be able to print using a PRINT button.
To do this I will need a "printer friendly" version of the page without the header/footer and some graphic border changes.
I can create a separate CF template (for printing) and dynamically build the page again when the PRINT button is hit - BUT there is a small chance that the data could change in between.
How is this done with dynamic pages - to create printer friendly versions without rebuilding the data in CF. Is CFdocument involved?
Thanks in advance (but confused)
hefterr
ASKER
Hi JohnHowlett,
Thanks for an answer so quickly.
I am basically doing this - but the new page retrieves again the data from the DB and it's possible an order status (for example) has changed when re-retrieved by the new page. It's not just making it printer friendly - but also keeping the data the same.
hefterr
Thanks for an answer so quickly.
I am basically doing this - but the new page retrieves again the data from the DB and it's possible an order status (for example) has changed when re-retrieved by the new page. It's not just making it printer friendly - but also keeping the data the same.
hefterr
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi JohnHowlett:
I guess one way or another you have to save the "state" of the data in advance in case the print button is subsequebtly hit. Can you use the "cfsavecontent" and also output a page at the same time with the same HTML/CF?
This sounds like high overhead as the print page button will not be frequently used. I found another post on EE using a bit of Javascript that may help out:
https://www.experts-exchange.com/questions/25271624/Print-a-Coldfusion-Page.html
Thanks for your help!!!
hefterr
I guess one way or another you have to save the "state" of the data in advance in case the print button is subsequebtly hit. Can you use the "cfsavecontent" and also output a page at the same time with the same HTML/CF?
This sounds like high overhead as the print page button will not be frequently used. I found another post on EE using a bit of Javascript that may help out:
https://www.experts-exchange.com/questions/25271624/Print-a-Coldfusion-Page.html
Thanks for your help!!!
hefterr
ASKER
I guess my question is also "best practices".
Is it acceptable to go to (or pop up) a separate window that "rebuilds" the page with simpler formating (omit the header/footer and remove certain graphics). for printing? The downside, is that the data could possible change from the original page if (for example) the status of an order changed?
Or is this technique (I mentioned) a standard procedure on sites that provide "printer friendly version" button on a page. The interval is very small (I would imaging) between showing the original page and rebuilding the page if the user hits the "printer friendly" button.
Thanks in advance,
hefterr
Is it acceptable to go to (or pop up) a separate window that "rebuilds" the page with simpler formating (omit the header/footer and remove certain graphics). for printing? The downside, is that the data could possible change from the original page if (for example) the status of an order changed?
Or is this technique (I mentioned) a standard procedure on sites that provide "printer friendly version" button on a page. The interval is very small (I would imaging) between showing the original page and rebuilding the page if the user hits the "printer friendly" button.
Thanks in advance,
hefterr
<cfdocument format = "PDF" pagetype = "A4" orientation = "portrait">
<cfinclude template="[Your_original_f
</cfdocument>