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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...