Skip to main content

**Resolved** ThemeHidden Class not correctly applied in NativeExcel exports

Comments

4 comments

  • Johnny Stevens

    The only workaround I could find for this issue is to add a Local Datalayer with a Calculated Column that sets a value based on the Request.Token/trigger:

    <LocalData ID="ldIncludeDetail">
      <DataLayer Type="Static" ID="dlsIncludeDetail">
        <StaticDataRow value="1" />
        <CalculatedColumn ID="hideDetailShowMode" Formula="IIF(@Request.inpInclEncDetail~=0,'None','All')" />
      </DataLayer>
    </LocalData>

    This returns "All" or "None" which I can use as a Show Mode in the Group Header Row. Not the cleanest option, but it appears to work for this use case.

    0
  • VISUI

    This is a bit overly complex, but it works well with Logi Elements that do not provide a condition property.

    You can create a Shared Element and place it within a different report definition.  For some reason Logi will sometimes throw an error if it is within the same definition.  The only thing this Generic Shared Element has within it is an Include Shared Element where the content will be passed into.  This makes it reusable for many purposes.

     

    <Report ID="LogiForum.ExportThemeHiddenSE">
      <SharedElement ID="genericSharedElement">
        <IncludeSharedElement DefinitionFile="PassedSharedElement" SharedElementID="content" />
      </SharedElement>
    </Report>

     

    Beneath the DataTable element within your Report Definition Include the Generic Shared Element. 

    You can now set a condition on the includeSharedElement to conditionally display it or not.

    Add a PassedSharedElement called "content" beneath the included genericSharedElement.

    Paste your content beneath the "content" PassedSharedElement (in this case your entire Group Header Row)

     

    <Report ID="LogiForum.ExportThemeHidden">
      <Body>
        <Division HtmlDiv="True" ID="divResults">
          <DataTable AccessibleHeaders="True" AccessibleSummary="DataTable" ID="DataTable1" KeepScrollPosition="True" RememberSort="True" ResizableColumns="True" SortArrows="True" TableBorder="0">
            <DataLayer ID="StaticDataLayer1" Type="Static">
              <StaticDataRow id="1" quantity="14" type="apple" />
              <StaticDataRow id="1" quantity="8" type="orange" />
              <StaticDataRow id="2" quantity="1" type="apple" />
              <GroupFilter GroupColumn="id" ID="grpId" KeepGroupedRows="True">
                <GroupAggregateColumn AggregateColumn="quantity" AggregateFunction="Sum" ID="sumQuantity" />
              </GroupFilter>
            </DataLayer>
            <DataTableColumn ID="colId">
              <Label Caption="@Data.id~" />
            </DataTableColumn>
            <DataTableColumn Header="type" ID="coltype">
              <Label Caption="@Data.type~" ID="lbltype" />
            </DataTableColumn>
            <DataTableColumn Header="quantity" ID="colquantity">
              <Label Caption="@Data.quantity~" ID="lblquantity" />
            </DataTableColumn>
            <IncludeSharedElement DefinitionFile="LogiForum.ExportThemeHiddenSE" SharedElementID="genericSharedElement" Condition="&quot;@Request.rdReportFormat~&quot; &lt;&gt; &quot;NativeExcel&quot;">
              <PassedSharedElement ID="content">
                <GroupHeaderRow GroupFilterID="grpId" ID="grpHdrId">
                  <Column ID="grpColId">
                    <Label Caption="@Data.id~" />
                    <ExcelColumnFormat />
                  </Column>
                  <Column ID="colspacer">
                    <ExcelColumnFormat />
                  </Column>
                  <Column ID="grpColQuantity">
                    <Label Caption="Sum: @Data.sumQuantity~" ID="lblsumQuantity" />
                    <ExcelColumnFormat />
                  </Column>
                </GroupHeaderRow>
              </PassedSharedElement>
            </IncludeSharedElement>
          </DataTable>
        </Division>
        <Button Caption="Excel" ID="butExport">
          <Action ID="actExcel" Type="NativeExcel">
            <Target ExcelOutputFormat="Excel2007" FrameID="NewWindow" Type="NativeExcel">
              <WaitPage />
            </Target>
          </Action>
        </Button>
      </Body>
      <ideTestParams rdReportFormat="" />
    </Report>

     

    In this example I removed your "ThemeHidden" class to show that the condition is functioning properly



    0
  • Johnny Stevens

    Thanks again, VISUI

    I've got this working and I can also use the Local All/None Token in the ShowMode.

    For future posterity, the Local Token method will still process the Group Header Row, but won't show it; VISUI's solution using the Shared Element will keep the Group Header Row from processing (using the Condition). If you don't want the Group Header Row in the page/report source, I recommend using the Shared Element.

    0
  • VISUI

    The Shared Element trick works with more than just a data table's group header row.

    You can use it to allow a user to choose Landscape or Portrait PDF export by passing in pertinent Printable Paging settings.

    Also works with chart series, chart legends, and other chart elements as well that need to be conditionally shown.

    0

Please sign in to leave a comment.