Repeat Element DataLayers that need "default" parameter values on initial load
Good morning!
We have a requirement where we know that a good solution is to create Divs and DataTables using Repeat Elements. Where we are struggling is implementing the datalayer for the Repeat Elements. This layer is a call to SQL with a number of parameters, a mixture of strings and dates. These values will either be from @session tokens or selected by the users from Input Select Lists or Calendar Inputs. These user inputs are to have a default value on the initial report load.
The issue I have is you cannot use parameters set by the Default Request Parameter element in a Repeat Element datalayer. I have tried to implement this using a main and subreport setup, with the user controls in the main report (with default values set) and the subreport being the actual content created using Repeat Elements. This almost works, but the default values don't get sent through to the subreport on inital load. It only works once the user invokes the Action.Refresh to update the SubReport.
How can I send default values on initial report load, so that the Repeat Element datalayer is populated (unfortunately having the database handle default values is not an option in this case as some parameters are user specific).
TIA
Martin
-
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 -
1
-
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 -
Martin,
Glad it helped out.
Regards,
John - VISUI
0
Please sign in to leave a comment.
Comments
4 comments