Reporting

Remove Chart in PDF report in Splunk 5

asarolkar
Builder

Hi,

Using the new PDF export feature in Splunk 5, I generate a PDF report that prints multi-line results per Organization.

This works perfectly.

However there are 10,000+ organizations with TIMES 20 rows per org.

There is an ugly chart that the report displays on top (because the search I used has a stats in it).

Anybody know how to remove a chart on top from a Splunk 5 PDF report when the search that generates the report has a "stats" in its criteria ?

Tags (4)

paramagurukarth
Builder

I don't know any straight forward answer for this. but I have an work around for this..
My Suggestion is :
* Create a css file inside your apps appserver/static directory
* Edit your appserver/static/application.js as below

switch (Splunk.util.getCurrentView()) {
    case "Your_view_name":
        if(window.location.href.indexOf("output=pdf")){
            jQuery("<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/app/AppName/cusPdf.css\"/>").appendTo("head");
        }
        break;
}

The above code will load your css file into your html only when the url contains teh string "output=pdf" (It is the parameter required to generate pdfs).

Inside your css file , write your css rules to hide the map or table or graph you want.. Even you can customize your PDF contents 🙂

 eg:
.firstCell {
    display: none !important;
}

If you know the the UI module used by your graph or charts you can directly sett= inline style using javascript/jQuery ...
Refer sample application.js for more info
http://docs.splunk.com/Documentation/Splunk/6.2.2/Module/Example3-Simplecustomizations

0 Karma

o_calmels
Communicator

Hi, if still applicable on december 2014

Can you post your search request please ?
Olivier.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...