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
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...