Cascading parameters, how to update the child parameters and a charting object at the same time.
Hello all,
I have a report that has 2 input select lists. The first set of values is depends on the user, the second depends on the user and the value they have picked from the first drop down. What I really need to happen is for the associated chart to refresh and display the "initial" values that are populated in the drop downs. The way I currently have it, as the second drop down and the chart are refreshed at the same time after the first dropdown is selected, the chart does not get the second value until that drop down is changed. I hope this makes sense! Hopefully the example below better explains it!
<?xml version="1.0" encoding="utf-8"?>
<Report
ID="Default"
>
<DefaultRequestParams
selEmployee="Frank"
/>
<Body>
<InputSelectList
DefaultValue="@Request.selEmployee~"
ID="selEmployee"
OptionCaptionColumn="Employee"
OptionValueColumn="Employee"
>
<DataLayer
Type="Static"
>
<StaticDataRow
Employee="Frank"
/>
<StaticDataRow
Employee="Bob"
/>
<StaticDataRow
Employee="Dave"
/>
</DataLayer>
<EventHandler
DhtmlEvent="onchange"
>
<Action
ElementID="divChart"
ID="refreshChart"
Type="RefreshElement"
/>
</EventHandler>
</InputSelectList>
<Division
ID="divChart"
>
<InputSelectList
ID="selYear"
OptionCaptionColumn="Year"
OptionValueColumn="Year"
>
<DataLayer
Type="Static"
>
<StaticDataRow
Employee="Frank"
Year="2010"
/>
<StaticDataRow
Employee="Frank"
Year="2011"
/>
<StaticDataRow
Employee="Bob"
Year="2012"
/>
<StaticDataRow
Employee="Bob"
Year="2013"
/>
<StaticDataRow
Employee="Dave"
Year="2014"
/>
<StaticDataRow
Employee="Dave"
Year="2015"
/>
<CompareFilter
CompareType="="
CompareValue="@Request.selEmployee~"
DataColumn="Employee"
ID="cmpEmployee"
/>
</DataLayer>
<EventHandler
DhtmlEvent="onchange"
>
<Action
ElementID="PieChartCanvas1"
ID="refreshChart"
Type="RefreshElement"
/>
</EventHandler>
</InputSelectList>
<ChartCanvas
ChartCaption="Count of Sales by Product"
ID="PieChartCanvas1"
>
<Series
ChartLabelColumn="Product"
ChartYDataColumn="rdGrAggr-Sales-sum"
Type="Pie"
>
<Quicktip>
<QuicktipRow
Caption="Product: "
Value="@Chart.Product~"
/>
<QuicktipRow
Caption="Sales: "
Format="#,##0."
Value="@Chart.rdGrAggr-Sales-count~"
/>
</Quicktip>
</Series>
<RelevanceFilter
IrrelevanceLabel="Other"
RelevanceType="NumberOfRows"
RelevanceValue="8"
/>
<DataLayer
ID="StaticDataLayer1"
Type="Static"
>
<GroupFilter
DataType="Text"
GroupColumn="Product"
KeepGroupedRows="False"
>
<GroupAggregateColumn
AggregateColumn="Sales"
AggregateFunction="Sum"
DataType="Number"
ID="rdGrAggr-Sales-sum"
/>
</GroupFilter>
<SortFilter
DataType="Number"
SortColumn="rdGrAggr-Sales-count"
SortSequence="Descending"
/>
<StaticDataRow
Employee="Frank"
Product="A1"
Sales="100"
Year="2010"
/>
<StaticDataRow
Employee="Frank"
Product="A2"
Sales="100"
Year="2010"
/>
<StaticDataRow
Employee="Frank"
Product="B1"
Sales="200"
Year="2011"
/>
<StaticDataRow
Employee="Frank"
Product="B2"
Sales="300"
Year="2011"
/>
<StaticDataRow
Employee="Bob"
Product="C1"
Sales="300"
Year="2012"
/>
<StaticDataRow
Employee="Bob"
Product="C2"
Sales="450"
Year="2012"
/>
<StaticDataRow
Employee="Bob"
Product="D1"
Sales="400"
Year="2013"
/>
<StaticDataRow
Employee="Bob"
Product="D2"
Sales="600"
Year="2013"
/>
<StaticDataRow
Employee="Dave"
Product="E1"
Sales="500"
Year="2014"
/>
<StaticDataRow
Employee="Dave"
Product="E2"
Sales="40"
Year="2014"
/>
<StaticDataRow
Employee="Dave"
Product="F1"
Sales="800"
Year="2015"
/>
<StaticDataRow
Employee="Dave"
Product="F2"
Sales="600"
Year="2015"
/>
<CompareFilter
CompareType="="
CompareValue="@Request.selYear~"
DataColumn="Year"
ID="cmpYear"
/>
<CompareFilter
CompareType="="
CompareValue="@Request.selEmployee~"
DataColumn="Employee"
ID="cmpEmployee"
/>
</DataLayer>
<ChartCanvasLegend/>
</ChartCanvas>
</Division>
</Body>
<ideTestParams
selEmployee=""
selYear=""
/>
</Report>
-
Martin,
I submitted another response with code, but it is pending approval. Logi needs to either monitor these forums daily or get the approval process fixed.
You could simply add a blank image with an onload event within the divChart division that simply performs an Action.Refresh on PieChartCanvas1.
Whenever selEmployee changes values it issues a refresh of divChart. This will then automatically refresh the PieChartCanvas1 passing the current values for selEmployee and selYear.
0 -
Hi VISUI,
Oh this is clever! Thanks so much.Martin
0
Please sign in to leave a comment.
Comments
2 comments