Skip to main content

Repeat Element DataLayers that need "default" parameter values on initial load

Comments

4 comments

  • VISUI

    Since the subreport has the repeat element you can set default parameters in your main report using default request parameters.  Then use an SubReport mode of IncludeFrame and pass the request parameters into the subreport using Link Parameters.

     

    LogiForum.RepeatMain

    <Report ID="LogiForum.RepeatMain">
      <DefaultRequestParams Name="Red" />
      <Body>
        <InputSelectList OptionCaptionColumn="Name" ID="Name" OptionValueColumn="Name" DefaultValue="@Request.Name~">
          <EventHandler DhtmlEvent="onchange">
            <Action Type="RefreshElement" ElementID="divRepeat" ID="areRepeat" />
          </EventHandler>
          <DataLayer Type="Static">
            <StaticDataRow Name="Red" />
            <StaticDataRow Name="Blue" />
            <StaticDataRow Name="Green" />
          </DataLayer>
        </InputSelectList>
        <Division ID="divRepeat">
          <Label Caption="@Request.Name~" />
          <IncludeFrame ID="subRepeat" SubReportMode="IncludeFrame">
            <Target Type="IncludeFrameReport" Report="LogiForum.RepeatSub" ID="tgtRepeat" />
            <LinkParams Name="@Request.Name~" />
          </IncludeFrame>
        </Division>
      </Body>
      <ideTestParams Name="" />
    </Report>

     

    LogiForum.RepeatSub.lgx

    <Report ID="LogiForum.RepeatSub">
      <Body>
        <RepeatElements ID="repName">
          <DataLayer Type="Static">
            <StaticDataRow Name="Red" />
            <StaticDataRow Name="Blue" />
            <StaticDataRow Name="Green" />
            <StaticDataRow Name="Red" />
            <StaticDataRow Name="Blue" />
            <StaticDataRow Name="Green" />
            <StaticDataRow Name="Red" />
            <StaticDataRow Name="Blue" />
            <StaticDataRow Name="Green" />
            <CompareFilter CompareType="=" DataColumn="Name" ID="cfName" CompareValue="@Request.Name~" />
            <SequenceColumn ID="seqid" />
          </DataLayer>
          <HtmlTag HtmlTagName="div" ID="div@Repeat.seqid~">
            <HtmlAttributeParams style="height: 100px; width: 100px; margin: 10px; background-color: @Request.Name~;" />
            <Label Caption="Repeat: @Repeat.Name~" />
          </HtmlTag>
        </RepeatElements>
        <Label Caption="Request: @Request.Name~" />
      </Body>
      <ideTestParams Name="" />
    </Report>
    1
  • VISUI

    1
  • Martin Rees

    Hi VISUI,

    Thanks so much for this.  To be honest I'm now not sure what I was doing wrong, but by taking your example and starting again I have now a working report.

    Thank you for your help!

    Martin

    1
  • VISUI

    Martin,

    Glad it helped out.

    Regards,

    John - VISUI

    0

Please sign in to leave a comment.