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’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...