Cognos Analytics

 View Only
Expand all | Collapse all

Global Header and Footer Message On All Printed Reports

  • 1.  Global Header and Footer Message On All Printed Reports

    Posted Fri January 08, 2021 05:41 PM
      |   view attached
    Good Evening,

    I hope that you and yours are all doing well.  We would like a specific header and footer to appear on every exported or printed report.  For example, if the user runs the report as a pdf or Excel, we want the header and footer to appear on each report.  The header and footer verbiage would be configured on the server by the System Admin as a system-side default process with no local user configuration.  How would a System Admin make this change?

    Warm Regards,
    Eli

    #CognosAnalyticswithWatson

    Attachment(s)

    pdf
    pdfExample.pdf   189 KB 1 version


  • 2.  RE: Global Header and Footer Message On All Printed Reports

    IBM Champion
    Posted Mon January 11, 2021 03:10 AM
    Hello @Elihu El,

    in the archive(s) GlobalReportStyles.css you can find .ph and .pf declaring the styles for header and footer of any report.

    In the example below, we added a watermark "confidential" image to any report:
    .ph,.pf{
    vertical-align: top;padding: 4px 8px;
    background-image:url(amvara_confidential.gif);
    background-repeat:no-repeat;
    background-position:center;
    }

    Using CSS before:: and after:: you could achieve adding text as in your example.

    The GlobalReportStyles.css files are somehow scattered around the filesystem and depending on your installation you must modify them on GW and/or the APP.-SERVER.
    Rendering PDF is done on the App.-Server, so you will need modification there. Rendering HTML is mainly served  by the GW. So, you would need the modification there.

    root@amvara:/opt/IBM/cognos/crn0 : find ./ -name "GlobalReport*css"
    ./webcontent/bi/schemas/GlobalReportStyles.css
    ./webcontent/bi/schemas/GlobalReportStyles_1.css
    ./webcontent/bi/schemas/GlobalReportStyles_10.css
    ./webcontent/bi/schemas/GlobalReportStyles_11.4.css
    ./webcontent/bi/schemas/GlobalReportStyles_11.5.css
    ./webcontent/bi/schemas/GlobalReportStyles_11.6.css
    ./webcontent/bi/schemas/GlobalReportStyles_11.css
    ./webcontent/bi/schemas/GlobalReportStyles_none.css
    ./webcontent/bi/schemas/GlobalReportStyles_var.css
    ./webcontent/bi/reportstyles/GlobalReportStyles.css
    ./webcontent/bi/reportstyles/GlobalReportStyles_1.css
    ./webcontent/bi/reportstyles/GlobalReportStyles_10.css
    ./webcontent/bi/reportstyles/GlobalReportStyles_11.4.css
    ./webcontent/bi/reportstyles/GlobalReportStyles_11.5.css
    ./webcontent/bi/reportstyles/GlobalReportStyles_11.6.css
    ./webcontent/bi/reportstyles/GlobalReportStyles_11.css
    ./webcontent/bi/reportstyles/GlobalReportStyles_none.css
    ./webcontent/bi/reportstyles/GlobalReportStyles_var.css
    ./webcontent/schemas/GlobalReportStyles.css
    ./webcontent/schemas/GlobalReportStyles_1.css
    ./webcontent/schemas/GlobalReportStyles_10.css
    ./webcontent/schemas/GlobalReportStyles_11.4.css
    ./webcontent/schemas/GlobalReportStyles_11.5.css
    ./webcontent/schemas/GlobalReportStyles_11.6.css
    ./webcontent/schemas/GlobalReportStyles_11.css
    ./webcontent/schemas/GlobalReportStyles_none.css
    ./webcontent/schemas/GlobalReportStyles_var.css
    ./webcontent/schemas/GlobalReportStyles_10_NS.css
    ./webcontent/schemas/GlobalReportStyles_11.4_NS.css
    ./webcontent/schemas/GlobalReportStyles_11_NS.css
    ./webcontent/schemas/GlobalReportStyles_1_NS.css
    ./webcontent/schemas/GlobalReportStyles_NS.css
    ./webcontent/schemas/GlobalReportStyles_none_NS.css
    ./reportstyles/GlobalReportStyles.css
    ./reportstyles/GlobalReportStyles_1.css
    ./reportstyles/GlobalReportStyles_10.css
    ./reportstyles/GlobalReportStyles_11.4.css
    ./reportstyles/GlobalReportStyles_11.5.css
    ./reportstyles/GlobalReportStyles_11.6.css
    ./reportstyles/GlobalReportStyles_11.css
    ./reportstyles/GlobalReportStyles_none.css
    ./reportstyles/GlobalReportStyles_var.css

    Hope this helps.


    ------------------------------
    Ralf Roeber
    ------------------------------



  • 3.  RE: Global Header and Footer Message On All Printed Reports

    Posted Tue January 12, 2021 10:49 AM
    Good Morning,

    I hope that your day has gotten off to a good start.  I have added this - 
    .ph,.pf{
     vertical-align: top;padding: 4px 8px;
     background-image:url(amvara_confidential.gif);
     background-repeat:no-repeat;
     background-position:center;
    }

    ...towards the top of each of these files:
    ./webcontent/bi/schemas/GlobalReportStyles.css
    ./webcontent/bi/reportstyles/GlobalReportStyles.css
    ./webcontent/schemas/GlobalReportStyles.css
    ./reportstyles/GlobalReportStyles.css

    However, I am seeing no change.  How would I confirm that I am modifying the correct file?

    Continued Regards,
    Eli






  • 4.  RE: Global Header and Footer Message On All Printed Reports

    IBM Champion
    Posted Tue January 12, 2021 12:18 PM
    Edited by System Fri January 20, 2023 04:24 PM
    Hello Eli,

    did you place the image "amvara_confidential.gif" in the corresponding folders?

    root@amvara:/opt/IBM/cognos/crn0 : find ./ -name "amvara_confidential.gif"
    ./webcontent/bi/schemas/amvara_confidential.gif
    ./webcontent/bi/reportstyles/amvara_confidential.gif
    ./webcontent/schemas/amvara_confidential.gif
    ./reportstyles/amvara_confidential.gif

    The result will look like this (depending on your image of course):
    Confidential Watermark in Querystudio

    The screenshot is from QueryStudio - which I believe would not benefit from the other proposals to your request.

    I tested this on CA11.1.5 ... and wuuuhuu ... .ph and .pf were removed from the default layouts. Sorry for that, Eli.

    So, placeing something like this in your css files:

    .pb::before {
    background-image: url("/crn0/bi/schemas/amvara_confidential.gif");
    text-align:center;
    background-size: contain;
    content:"--- BEFORE ---";
    border:1px solid red;
    display: inline-block;
    vertical-align: middle;
    margin-left:calc(50% - 50px)
    }
    .pb::after {
    background-image: url("/crn0/bi/schemas/amvara_confidential.gif");
    text-align:center;
    background-size: contain;
    content:"--- AFTER ---";
    border:1px solid red;
    display: inline-block;
    vertical-align: middle;
    margin-left:calc(50% - 50px)
    }

    td[specname="pageHeader"] {
    background-color:red;
    background-image: url("/crn0/bi/schemas/amvara_confidential.gif");
    height:25px;
    }
    td[specname="pageFooter"] {
    background-color:red;
    background-image: url("/crn0/bi/schemas/amvara_confidential.gif");
    height:25px;
    }

    In your CSS files, would do the trick.

    ".pb" is the pageBody element. The pageFooter and pageHeader elements are inserted if you use them. So users that do not put a header/footer will not see them.

    It will look like this:


    You can try it out in Chrome dev-Tools (F12)
    Hope this helps.




    ------------------------------
    Ralf Roeber
    ------------------------------



  • 5.  RE: Global Header and Footer Message On All Printed Reports

    Posted Mon April 19, 2021 09:01 AM
    Good Morning Ralf,

    I hope that your day is going well.  Where should I place the amvara_confidential.gif file?  

    Should the css style make a relative or absolute reference to the gif file?

    If the css resides here: ./webcontent/bi/schemas/GlobalReportStyles_1.css
    Should the css style make a relative or absolute reference to the gif file?
    Where should the amvara_confidential.gif file be located?

    Also, should the newly added css be located at the top or bottom of the css file(s)?

    Continued Regards,
    Eli






  • 6.  RE: Global Header and Footer Message On All Printed Reports

    Posted Thu April 22, 2021 08:39 AM
    Good Morning,

    I am not familiar with the crn0 directory.  Where is it?

    Warm Regards,
    Eli





  • 7.  RE: Global Header and Footer Message On All Printed Reports

    Posted Fri January 29, 2021 05:36 PM
    ...Do I need to modify all 30  or so *GlobalReportStyles*.css files or the 4 "GlobalReportStyles.css" files only?





  • 8.  RE: Global Header and Footer Message On All Printed Reports

    Posted Mon April 19, 2021 08:49 AM
    Good Morning Ralf,

    I hope that your day is going well.  Where should I place the amvara_confidential.gif file?  

    Should the css style make a relative or absolute reference to the gif file?

    If the css resides here: ./webcontent/bi/schemas/GlobalReportStyles_1.css
    Should the css style make a relative or absolute reference to the gif file?
    Where should the amvara_confidential.gif file be located?

    Also, should the newly added css be located at the top or bottom of the css file(s)?

    Continued Regards,
    Eli





  • 9.  RE: Global Header and Footer Message On All Printed Reports

    Posted Mon January 11, 2021 03:20 AM
    Hi Eli, 

    As Ralf pointed out, one option is to update the style sheets and that will affect ALL the reports. If you want to have more control then you can create custom classes and use those for page headers and footers in reports (by default global class PageHeader is applied for a header - look at header properties in report for Classes) and modify them as explained by Ralf based on your needs. 

    The other option is to look for some tool like Meta Manager where you can update the definition (like headers and footers in your case) of the selected reports at once using Template Blasters or a similar feature depending on the tool whenever your admin wants. 

    Regards

    ------------------------------
    Kiran Passumarthi
    www.linkedin.com/in/kiranpassumarthi
    ------------------------------



  • 10.  RE: Global Header and Footer Message On All Printed Reports

    Posted Mon January 11, 2021 08:04 AM
    Edited by System Fri January 20, 2023 04:44 PM
    Hi Eli,

    The best "out of the box" way to do this is using the Layout Component Reference.

    Reuse a Layout Object (ibm.com)

    This will allow you to define a master template with the header and footer you desire and apply the layout to all reports.  You can then make changes to the master template and all reports will be updated.  The location of the template can be secured to only allow administrators to edit.

    Hope this helps!

    ------------------------------
    Todd Schuman
    ------------------------------



  • 11.  RE: Global Header and Footer Message On All Printed Reports

    Posted Fri January 29, 2021 05:18 PM
    ...I am using Cognos Analytics / Report Studio 11.1.7.

    These recommendations still do not work.