9 Replies Latest reply on Oct 18, 2018 2:50 PM by Calcioscacchi

    Button to print a pdf page from dashboard

    Calcioscacchi

      Hello!

       

      Usually, to print a PDF page from a dashboard, i use the path Options-->Print-->PDF.

       

      I'm asking if there is the possibility to put in my dashboard pages a button (like an action) that let me print my pdf document immediately. In other words, i need a button that call the action called by the path above.

      Someone can help?

       

      Thank you!

        • 2. Re: Button to print a pdf page from dashboard
          Calcioscacchi

          Hi,

           

          thanks for the answer.

           

          Almost: in that article you need to set your prompts to aim all dashboard pages, but in my case, i need to aim only the page where the prompt is used.

          Just a question: why should i remove the prompt? Can i just filter my data with the page prompt, and then print the pdf document?

          • 3. Re: Button to print a pdf page from dashboard
            Gianni Ceresa

            Hi,

            I guess you need to read, understand and then adapt the solution of the link posted by Robert.

             

            That blog post cover a very specific need which is linked to printing in PDF without seeing the prompts in the PDF. You don't have that need, you just want to print.

            So based on the blog posts you can see how they managed to print in PDF without using the default menu entry in OBIEE, just take that part of the solution without paying attention to the prompts.

             

            As an alternative you can simply take your OBIEE page, open the developer tool extension of your browser and analyse what the default entry to print as PDF does. Then you simple do the same in your button. I didn't look in a real OBIEE, but based on the blog post linked above it seems to just be a javascript call to a function with some parameters. So look at exactly what call is done with which parameters and done.

            • 4. Re: Button to print a pdf page from dashboard
              Robert Angel

              Sorry, not had the need to try it for myself, I would follow @Gianni's advice of digest, contemplate, adapt - good advice for life in general perhaps...

              • 5. Re: Button to print a pdf page from dashboard
                Calcioscacchi

                Hi guys,

                Gianni Ceresa yes, i thought about is (similar at macro registrator in excel), but i don't know java or html code.

                 

                i adapt the code to my solutions and it works, thanks a lot!

                Just a few things (maybe i should open another discussion?): the text of the button appears in my pdf page (as part of a section), do you know how to modify the code in order to don't print the button text?

                If not, it doesn't matter, i can mask it as a title of the report page.

                 

                Thanks for the help!

                • 6. Re: Button to print a pdf page from dashboard
                  Gianni Ceresa

                  That's why the blog posts was using a hidden page without the prompts

                  The print will include everything you have in the page, so if the button is in the page, it will be printed out.

                   

                  Because the "PDF printer" isn't able to understand everything you can probably cheat a bit by using full javascript instead of direct HTML code to display the button. I'm optimistic the PDF printer embedded in OBIEE will not be smart enough to understand what it means, so you will probably not see it anymore.

                  • 7. Re: Button to print a pdf page from dashboard
                    Calcioscacchi

                    ok, but i think that to apply that, i have to know javascript, and i don't XD.

                     

                    I will do something about it.

                    Last question that i forgot in the preview answer: how can i hide the section borders from the pdf print? I use OBIEE 11.1.1.9.160419

                    • 8. Re: Button to print a pdf page from dashboard
                      Gianni Ceresa

                      Yes, you would need to understand the basics of javascript. Google could clearly just give you a piece of code to copy/paste, but I really believe it's safer if you stay on things you master, at least you don't add more issues trying to solve a thing with some random javascript.

                       

                      Try your best with the sections properties, but I wouldn't be surprised if, in the end, the border are always there in the PDF. The PDF printer is a bit weird on some aspects, it doesn't always translate 100% exactly what you have in the page. Maybe also worth to search MOS to see if it isn't the "normal" behaviour (and maybe there is either a patch or a workaround there).

                      You could even try setting the borders to be white, downside is that you will see them on the webpage as white, but if the printer works fine you will have white borders on a white background PDF = invisible ...

                      • 9. Re: Button to print a pdf page from dashboard
                        Calcioscacchi

                        As you thought... i still see the borders.

                         

                        Thanks for the help