Skip to main content

HTML image as a button that exports a grid on a document to Excel in MicroStrategy

HTML Image as a Button That Exports a Grid on a Document to Excel in MicroStrategy

In MicroStrategy Web, it is possible to use an image as a button to export a grid on a document to Excel in MicroStrategy version 10.4 and later. This document provides the steps to accomplish the same. 

The goal is to create an image link that is used to export the grid, like shown below:

ExportGrid

Document in Edit Mode

EditMode

Follow the steps below:

1. Create a Report Services Document
2. Make two grids with different attributes and metrics in each 
3. Insert an HTML 
container (and not an image) and insert the script below. Make sure the Project name matches the given project and gridKey matches (highlighted in bold in the script below). The code below is used for the first grid and button. Main things to watch are the gridKey values and the name of the element id which in the below code is exportLink.
 
<a target="_blank" id="exportLink" href=""><img height="50" width="50" src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Microsoft_Excel_2013_logo.svg/1200px-Microsoft_Excel_2013_logo.svg.png"" /></a>
 
<script>
        try {
            var baseUrl = "./Main.aspx?&evt=3132&src=mstrWeb.3132&executionMode=4&gridKey=K44&Main.aspx=-.MicroStrategy+Tutorial.34955_&rwExportMode=4&rwb=";
            var beanState = mstrmojo.App.docModel.bs;
            baseUrl = baseUrl + beanState;
            document.getElementById("exportLink").href = baseUrl;
        } catch (err) {
            document.getElementById("exportLink").href = "";
        }
</script>


4. Insert another HTML container and paste the script below. Make sure the Project name matches the given project and gridKey matches. The code below is used for the second grid and second button. The gridKey value is different here and the name of the element id which is exportLink2.
 
<a target="_blank" id="exportLink2" href=""><img height="50" width="50" src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Microsoft_Excel_2013_logo.svg/1200px-Microsoft_Excel_2013_logo.svg.png"" /></a>

 
<script>
        try {
            var baseUrl2 = "./Main.aspx?&evt=3132&src=mstrWeb.3132&executionMode=4&gridKey=K45&Main.aspx=-.MicroStrategy+Tutorial.34955_&rwExportMode=4&rwb=";
            var beanState2 = mstrmojo.App.docModel.bs;
            baseUrl2 = baseUrl2 + beanState2;
            document.getElementById("exportLink2").href = baseUrl2;
        } catch (err) {
            document.getElementById("exportLink2").href = "";
        }
</script>


5. Run in Presentation mode and Click the Buttons to test that the grids get exported successfully. 

Comments

  1. Hi , This is very helpful and Thanks for sharing information.
    I am facing issues in finding of gridKey .
    Could you please help in finding of gridKey .

    Thanks,
    Narayana A

    ReplyDelete
  2. Html Image As A Button That Exports A Grid On A Document To Excel In Microstrategy >>>>> Download Now

    >>>>> Download Full

    Html Image As A Button That Exports A Grid On A Document To Excel In Microstrategy >>>>> Download LINK

    >>>>> Download Now

    Html Image As A Button That Exports A Grid On A Document To Excel In Microstrategy >>>>> Download Full

    >>>>> Download LINK sh

    ReplyDelete

Post a Comment

Popular posts from this blog

Microstrategy Custom number formatting symbols

Custom number formatting symbols If none of the built-in number formats meet your needs, you can create your own custom format in the Number tab of the Format Cells dialog box. Select  Custom  as the Category and create the format using the number format symbols listed in the table below. Each custom format can have up to four optional sections, one each for: Positive numbers Negative numbers Zeros Text Each section is optional. Separate the sections by semicolons, as shown in the example below: #,###;(#,###);0;"Error: Entry must be numeric" For more examples, see  Custom number formatting examples . To jump to a section of the formatting symbol table, click one of the following: Numeric symbols Character/text symbols Date and time symbols Text color symbols Currency symbols Conditional symbols Numeric symbols For details on how numeric symbols apply to the Big Decimal data type, refer to the  Project Design Guide . Symbol

Case functions Microstrategy

Ca se functions Microstrategy Case functions return specified data in a SQL query based on the evaluation of user-defined conditions. In general, a user specifies a list of conditions and corresponding return values. Case This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. If all conditions are false, a default value is returned.  Case  can be used for categorizing data based on multiple conditions. This is a single-value function. Syntax Case ( Condition1 ,  ReturnValue1 ,  Condition2 , ReturnValue2 ,...,  DefaultValue ) Example Case(([Total Revenue] < 300000), 0, ([Total Revenue] < 600000), 1, 2) sum(Case (Day@DESC in (“Sat”,”Sun”), Sales, 0) {~+} Sum(Case(Category@DESC In("Books","Electronics"),Revenue,0)){~+} CaseV (case vector) CaseV  evaluates a single metric and returns different values according to the results. It can be used to perform transf

MicroStrategy URL API Parameters

MicroStrategy URL Structure The following table summarizes the root URL structure used for every request to MicroStrategy Web. Environment Main Application URL Administration URL J2EE http://webserver/MicroStrategy/servlet/mstrWeb http://webserver/MicroStrategy/servlet/mstrWebAdmin .NET http://webserver/MicroStrategy/asp/Main.aspx http://webserver/MicroStrategy/asp/Admin.aspx Every request sent to MicroStrategy Web calls a central controller. Parameters are appended to  Main.aspx  or  mstrWeb  (in a .NET and J2EE environment, respectively) to indicate to the controller how the request should be internally forwarded and handled. The following examples show a URL for accessing a MicroStrategy folder when the user does not have an existing session. The URL contains not only the parameters needed to connect to MicroStrategy Web, but also the parameters needed to log on and create a session. J2EE environment: <a href="http://webserver/Mi

Multi-Table Data Import(MTDI) from one or more supported data sources

Multi-Table Data Import(MTDI) from one or more supported data sources In MicroStrategy Analytics Enterprise Web 10 onewards, users can now simultaneously import two or more tables from one or more supported data sources, this feature is called Multi-Table Data Import (MTDI) which has been renamed as Super Cubes in MSTR 2019 (Does it sound like multisourcing for all the users without admin help?) Currently, all connectors in MicroStrategy Web 10 except " OLAP " and " Search Engine Indices " support Multi-Table Data Import. Users are able to add multiple tables/files when doing data import from single connector, as shown below: Users are also able to combine multiple tables/files from different sources and store them into one single Intelligent Cube, as shown below:

Report filters are being ignored in Microstrategy report SQL

Report filters are being ignored in Microstrategy report SQL When users run a report using a simple filter, the filter is not applied to the report in MicroStrategy Developer 9.x and 10.x. The results returned to the users are not filtered as expected. The Report SQL indicates that the filter has not been applied. CAUSE: One scenario is that the MicroStrategy 10.x SQL Engine is ignoring the conditionality at the report level because a metric in the report also contains a related conditionality which has been set to "remove related report filter elements" or "ignore" the filtering criteria at the report level. ACTION: When a report contains the above situation, the follow steps can be done to have both filters applied and be merged for the report results to be executed with: If the report's and metric's filter affect attributes from the same hierarchy, check that the following setting is un-checked: This setting is placed in the me

Control the display of null and zero metric values

Show   Control the display of null and zero metric values in a grid report You can determine how to display or hide rows and columns in a grid report that consist only of null or zero metric values. You can have MicroStrategy hide the rows and columns in the following ways: Hide rows and columns that consist only of null metric values Hide rows and columns that consist only of zero metric values Hide rows and columns that consist only of null or zero metric values (default) Once you have defined how MicroStrategy hides null and zero metric values in the grid, you can quickly show or hide the grid using the Hide Nulls/Zeros option in the Data menu, as described below, or by clicking the  Hide Nulls/Zeros  icon  in the Data toolbar. To determine how null and zero metric values are displayed or hidden in a grid report Open the report in Edit mode. From the  Tools  menu, select  Report Options . The Report Options dialog box opens. To determine how

Prompt-in-prompt(Nested Prompts) in Microstrategy

Prompt-in-prompt(Nested Prompts) in  Microstrategy Nested prompts allows you to create one prompt based on the other and other bases on another, nested prompts allows us to prompt the highest level(Like year) to middle level(like Quarter, then to the low level(like Month). Here you can see how to  create a 3-level deep nested prompt that will prompt the user to select a year, then a quarter within that year, then a month within that quarter. Prompt-in-prompt is a feature in which the answer to one prompt is used to define another prompt. This feature is only implemented for element list prompts . The following procedure describes how to achieve this: Create the highest level filter. This is a filter which contains a prompt on an attribute element list. Create a filter on the attribute "Year." Click "prompt on attribute element list" and click "Next" through the rest of the screens to accept the default values. Do not set any additio

Microstrategy document/dashboard applying selections as filters or slices

Applying selections as filters or slices In a Microstrategy Document the selections a user makes in a selector can either filter or slice the data in the target: Filtering means that the data for the current selection is calculated only when it is requested by the user. The selections are used to filter the underlying dataset before the metric values are aggregated at the level of the Grid/Graph that is displayed in the document. If the source attribute is not included in the Grid/Graph, the metric values from all the selected elements are aggregated and shown at the level specified in the Grid/Graph. All metric condition selectors (which filter metric values or ranks) and selectors that target other selectors filter data by default. You cannot change them to slicing selectors. Slicing means that the data for each available item in the selector is calculated in advance when the document is first displayed. Selections made while

Update the data on an Intelligent Cube without having to republish the entire cube in MicroStrategy

Update the data on an Intelligent Cube without having to republish the entire cube in MicroStrategy MicroStrategy has introduced a feature known as, Incremental Refresh Options, which allow Intelligent Cubes to be updated based on one or more attributes, by setting up incremental refresh settings to update the Intelligent Cube with only new data. This can reduce the time and system resources necessary to update the Intelligent Cube periodically versus a full republish. For example, if a user has an Intelligent Cube that contains weekly sales data, the user may want this Intelligent Cube to be updated at the end of every week with the sales data for that week. By setting up incremental refresh settings, he can make it so that only data for one week is added to the Intelligent Cube, without affecting the existing data and without having to reload all existing data. Users can select two types of objects for the incremental fetch: a report or

Homogeneous vs heterogeneous column naming in Microstrategy

Homogeneous vs heterogeneous column naming Heterogeneous mapping: Suppose the data warehouse has information from two source systems, and in one source system regions are identified by column name Region_id and in the other the column name is Reg_id , as shown in the diagram below. Though the Region_id and Reg_id columns have different names, they store the same data: information about regions. This is called heterogeneous column naming . The data for the Lookup_Region table came from a different source system than the data for the Lookup_Call_Ctr and the source systems have different naming conventions. Homogeneous mapping: For consistency, it is a good idea for columns that contain the same data to have the same column name. This is called homogeneous column naming . In this case, the Region_ID column has the same name in both tables, as shown in the following diagram: