Search code examples
xmldatatableanalytics

Logi Analytics: write rows in a table in XML


How do I write a table in the Logi XML? I start with:

<PanelContent Height="1000">
          <DataTable ID="tblPreview" Width="1000" ResizableColumns="True">
            <DataTableColumn ID="colLabel" Header="Label" />
            <DataTableColumn ID="colAccepted" Header="Accepted" />
            <DataTableColumn ID="colEnriched" Header="Enriched" />
            <DataTableColumn ID="colValidated" Header="Validated" />
            <DataTableColumn ID="colToBeSigned" Header="To be signed" />
            <DataTableColumn ID="colToRelease" Header="To release" />
            <DataTableColumn ID="colReleased" Header="Released" />
            <DataTableColumn ID="colSending" Header="Sending" />
            <DataTableColumn ID="colSent" Header="Sent" />
</DataTable>

How do I add rows to the table?


Solution

  • Lumpi,

    For dynamic rows (where a row is displayed for each row in your datasource), add Label elements under each DataTableColumn element, like so:

    <DataTable ID="tblPreview" Width="1000" ResizableColumns="True">
      <DataTableColumn ID="colLabel" Header="Label">
        <Label Caption="@Data.Column1~" />
      </DataTableColumn>
      <DataTableColumn ID="colAccepted" Header="Accepted">
        <Label Caption="@Data.Column2~" />
      </DataTableColumn>
      <DataTableColumn ID="colEnriched" Header="Enriched">
        <Label Caption="@Data.Column3~" />
      </DataTableColumn>
      <DataTableColumn ID="colValidated" Header="Validated">
        <Label Caption="@Data.Column4~" />
      </DataTableColumn>
      <DataTableColumn ID="colToBeSigned" Header="To be signed">
        <Label Caption="@Data.Column5~" />
      </DataTableColumn>
      <DataTableColumn ID="colToRelease" Header="To release">
        <Label Caption="@Data.Column6~" />
      </DataTableColumn>
      <DataTableColumn ID="colReleased" Header="Released">
        <Label Caption="@Data.Column7~" />
      </DataTableColumn>
      <DataTableColumn ID="colSending" Header="Sending">
        <Label Caption="@Data.Column8~" />
      </DataTableColumn>
      <DataTableColumn ID="colSent" Header="Sent">
        <Label Caption="@Data.Column9~" />
      </DataTableColumn>
    </DataTable>
    

    The data references will tie back to columns in your datasource.

    For static rows, use the Rows element:

    <Rows>
      <Row ID="row1">
        <Column ID="colLabel">
          <Label Caption="@Data.value1~" />
        </Column>
        <Column ID="colAccepted">
          <Label Caption="@Data.value2~" />
        </Column>
        <Column ID="colEnriched">
          <Label Caption="@Data.value3~" />
        </Column>
        <Column ID="colValidated">
          <Label Caption="@Data.value4~" />
        </Column>
        <Column ID="colToBeSigned">
          <Label Caption="@Data.value5~" />
        </Column>
        <Column ID="colToRelease">
          <Label Caption="@Data.value6~" />
        </Column>
        <Column ID="colReleased">
          <Label Caption="@Data.value7~" />
        </Column>
        <Column ID="colSending">
          <Label Caption="@Data.value8~" />
        </Column>
        <Column ID="colSent">
          <Label Caption="@Data.value9~" />
        </Column>
      </Row>
      <Row ID="row2">
        <Column ID="colLabel">
          <Label Caption="@Data.value10~" />
        </Column>
        <Column ID="colAccepted">
          <Label Caption="@Data.value11~" />
        </Column>
        <Column ID="colEnriched">
          <Label Caption="@Data.value12~" />
        </Column>
        <Column ID="colValidated">
          <Label Caption="@Data.value13~" />
        </Column>
        <Column ID="colToBeSigned">
          <Label Caption="@Data.value14~" />
        </Column>
        <Column ID="colToRelease">
          <Label Caption="@Data.value15~" />
        </Column>
        <Column ID="colReleased">
          <Label Caption="@Data.value16~" />
        </Column>
        <Column ID="colSending">
          <Label Caption="@Data.value17~" />
        </Column>
        <Column ID="colSent">
          <Label Caption="@Data.value18~" />
        </Column>
      </Row>
    </Rows>
    

    Hope this helps.