Any way to stop specific parts of a page from displaying when included in a <cfdocument> tag for print?

Posted on 2007-07-24
Last Modified: 2013-12-24
I'm setting up a bunch of printable pages from my original cfml pages.  I am just wrapping a cfinclude in the cfdocument tag.  There are a few things on the cfinclude document that I do not want displayed at print time.  Is there anyway I can exclude these peices from displaying at printout?
Question by:MFredin
    LVL 14

    Accepted Solution

    You could set a variable before the include in template that generates the document and then check for the existance of that variable to determine if it should be included in the output.

    your page with the cfdocument tag woul look something like:
    <cfset request.isPrintOut = 1>
    <cfdocument format="pdf">
    <cfinclude template="myIncludedTemplate.cfm"

    myIncludedTemplate.cfm would be like:

    <cfif (not isDefined("request.isPrintOut")) or (request.isPrintOut neq 1)>
          stuff I don't want printed out goes here

    Author Comment

    That works.


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now