MicroStrategy ONE

Data Presentation

One of the most common requirements of a customized application is the ability to present data with the appropriate look and feel for an organization. Data presentation on MicroStrategy Web pages is controlled by a set of styles and a series of cascading style sheet (CSS) files, which are defined in two configuration files. This makes it quite easy for you to customize MicroStrategy Web so that it matches the look and feel of your company.

  • Page Configuration file:

    The cascading style sheets used to format data on MicroStrategy Web pages are included in external CSS files that are referenced by  "links" page-section files defined in the Page Configuration file, as well as a CSS file that is specific to the browser being used to view the page.:

Styles and the Style Catalog Configuration file

The three components of a style listed above are brought together within a <style> node in styleCatalog.xml, as illustrated in the code sample below. (This code sample defines an existing style, described as "Style: Display Report Graph for Printing", in the Style Catalog Configuration file.)

<Styles>

  ...

  <Style description="Style: Display Report Graph for Printing" name="ReportGraphStyle-ForPrint" transform="ReportGraphTransform">

    <ActualParameters>

      <ActualParametername="isDisableGraphDrilling" type="4" value="true"/>

      <ActualParameter name="showWidthHeightAttributes" type="4" value="false"/>

      <ActualParameter name="cssFile" type="1" value="ReportGraph.css"/>

      <ActualParameter name="graphSize" type="1" source="preference" value="graphSize"/>

      <ActualParameter name="graphWidth" type="2" source="preference" value="graphWidth"/>

      <ActualParameter name="graphHeight" type="2" source="preference" value="graphHeight"/>

    </ActualParameters>

    <Layouts>

      <Layout layout_source="AppLayoutSourceFile" order="1">

        <![CDATA[/WEB-INF/xml/layouts/ReportGraphOnlyLayout.xml]]>

      </Layout>

    </Layouts>

  </Style>

  ...

</Styles>        

Changing the value for one or more of these components can change the way that data is presented, resulting in an entirely different style. For example, two styles can have the same layout definition, but different transforms. They can have the same transform and transform parameters, but different layout definitions. Or, they can have the same transform, but different transform parameters.

Each of the three components that help to determine the way data is presented on a MicroStrategy Web page is described briefly below and in more detail in separate topics.

Refer to the Style Catalog Configuration File topic for a more detailed explanation of the XML configuration file that holds all of the MicroStrategy Web styles.

  • The transform associated with the style:

    A transform is a Java class that renders data— generally web bean data— on a MicroStrategy Web page. A transform typically contains a set of methods that separately render different pieces of the data. While Java programming skills are required to create a custom transform, it is often possible to create a new style— and thus a new way to present data— without writing code. To accomplish this, you use an existing transform and simply change the values of one or more transform parameters or apply a different layout definition— neither of which required a knowledge of Java coding.

    The transform associated with a style is specified by the transform attribute of the <style> node. For example, in the style used as an illustration in this topic (that is, the style whose name attribute is set to  "ReportGraphStyle-ForPrint"), the name of the transform that renders the data is "ReportGraphTransform", as defined by the transform attribute (transform="ReportGraphTransform") shown in bold in the code samples above and below. 

     <Style description="Style: Display Report Graph for Printing" name="ReportGraphStyle-ForPrint" transform="ReportGraphTransform">

    Every style must have an associated transform.

    Refer to the Transforms topic for a more detailed explanation of using transforms to customize data presentation.

  • The values of specified transform parameters whose default values should be overridden:

    Transforms typically have parameter fields whose values help to determine the way data is rendered. Transform parameters that correspond to the parameter fields in a particular transform class can be added to a MicroStrategy style that uses that transform. When a style is applied to render data, the value for any transform parameters values that are part of the style are used in place of the default parameter values in the transform. Changing the value of a transform parameter can change the way data is presented.

    Each transform parameter whose default value should be overridden is specified by an <ActualParameter> child node of the <style> node. The actual parameter to be overridden is specified by the name attribute of that <ActualParameter> node, and the value to be used in place of the default value is specified by the value attribute, as shown in bold in the code samples above and below.

     <ActualParametername="isDisableGraphDrilling" type="4" value="true"/>

    Parameters are not required to define a style because the transform contains default values for its parameters. An <ActualParameter> child node is added to the parent <style> node only if the value of the parameter must be changed in order for the transform to render the data in the desired manner for the style.

    Refer to the  Transform Parameters topic for a more detailed explanation of using transform parameters to customize data presentation.

  • The layout definition file used in conjunction with the transform:

    Layout definition files provide a code-free way to modify the actions of methods in the transform. The actual file to be used is generally a physical XHTML file specified by the <Layout> child node of the <style> node, but it can come from another source.

     <Layout layout_source="AppLayoutSourceFile" order="1">

       <![CDATA[/WEB-INF/xml/layouts/ReportGraphOnlyLayout.xml]]>

     </Layout>

    Layout definition files are not required to define a style, but they provide a convenient way to customize the level of details you want to display or modify the arrangement of content on the page without needing to write Java code.

    Refer to the Layout Definitions topic for a more detailed explanation of using layout definitions to customize data presentation.

Page Configuration file

The cascading style sheets used to format data on MicroStrategy Web pages are included in external CSS files, which are referenced by link tags in the HTML source for the page. The default page generates the links to application-wide CSS files, while individual pages generate the links to page-specific CSS files. The "links" page-section files on each page are responsible for generating the appropriate <link> tags. The code sample below illustrates how "links" page-section files are referenced by pages (including the default page) in the Page Configuration file.

J2EE environment:

<page...>

   <templates>

      <template ...>

         <page-sections ...>

             <page-section file-name="/jsp/TypeOfCssFile_Links.jsp" name="links"/>

.NET environment:

<page...>

   <templates>

      <template ...>

         <page-sections ...>

             <page-section file-name="/asp/TypeOfCssFile_Links.aspx"name="links"/>

The file-name attribute in the <page-section> node is set to the relative path to the global or page-specific "links" page-section file. For example, on the default page, the name of the file would be "Global_Links", while the name of the file on the Report Execution page would be "Report_Links".

When a MicroStrategy page is rendered, each page-section file generates one or more <link> tags like the ones shown below within the <head> tag of the page.

<link rel="stylesheet" type="text/css" href="../style/mstrWeb.css"/>

<link rel="stylesheet" type="text/css" href="../style/mstr/schemeDefault.css"/>

Refer to the Page Configuration File XML Structure topic for a more detailed explanation of the XML configuration file that holds the definitions of all the MicroStrategy Web pages, including the "links" page section for each page.

CSS files

MicroStrategy Web uses cascading style sheet (CSS) files when it generates the HTML source for a MicroStrategy Web page. It uses CSS files identified by "links" page-section files defined in the Page Configuration file, as well as a CSS file that is specific to the browser being used to view the page. If a page inherits page-sections from the default page, the <link> tags for the application-wide CSS files are generated first, followed by the <link> tags for the page-specific CSS files. Finally, the application automatically generates a single <link> tag to the browser-specific CSS file.