top of page
Writer's pictureOmar Vidaure

Custom Excel Export Button in MicroStrategy

Updated: Nov 26, 2019

I received a ton of feedback about my last post on creating custom PDF export buttons

(here). Most of the requests I received were about creating a custom Excel export button. No problem! I've outlined the same steps to create the custom excel export buttons below.


There are 3 things we need to make this happen

  1. The export function(s) we want to use

  2. A listener

  3. A button to trigger the function

These are all relatively easy to add in an html container within MicroStrategy. To begin add an html container to your document and make sure the Html Container is set to "HTML Text" in the properties.



add the snippet of code below;

<script>

function Export() {

mstrApp.docModel.controller.exportExcel();

}

document.getElementById("button").addEventListener("click",Export);

</script>

<input id="button" value="Export" type="button"></p>

</form>


This is great! Now I can create custom buttons for exporting directly from within the dashboard to trigger the export function.


Bonus: we can format/style the button however is needed to meet the requirements from within the HTML container. I typically like to set the button to transparent (with no text) overlay it on a custom image of my choice to give the user an even better over all experience! Have fun!


Update: See this post to format this button the easy way.

 

Thanks for checking out this blog post. If you found this post helpful please consider donating. Any contribution is appreciated! Just click the PayPal icon at the bottom of this page.





2,720 views7 comments

Recent Posts

See All

7 Comments


Ben Worsham
Ben Worsham
Oct 05, 2023

Hi will this work in MSTR Dossier?

Like

Omar Vidaure
Omar Vidaure
Jan 15, 2021

Rbogoni,

You can use both but you’ll need to rename the function from “Export” to something unique for each button.


Hope this helps!

Like

rbogoni
Jan 14, 2021

This is great, Omar! Thank you for sharing! Quick question - when I add this export button and your pdf export button to the same document, the pdf button does not work. Is there a way to get both of the buttons in one document?

Like

Omar Vidaure
Omar Vidaure
Nov 07, 2019

Thanks for the question. Similar code for the refresh. The only change is the mstr function being called. I’ll write this up 👍

Like

jeff.diver
Nov 06, 2019

Would this work for a refresh button also? What would the code look like if possible? Thanks

Like
bottom of page