Hi,
I am currently using the XamDataGrid. However I'm getting an error when exporting to excel (using the DataPresenterExcelExporter). I am doing the following:
Put some data into the grid, set some summaries. Let's say I set the count on one field and it comes up with Count: 100. Then I filter one of the fields, I now have Count: 25. Now I export to excel. The filtered rows appear in excel, i.e. I have 25 rows, but the Count at the top reads 100.
Any idea what I'm doing wrong here? The filter has worked on the rows in the export but not the summary.
Thanks,
Alastair
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Hi Stefan,
Unfortunately I need them at the top. What I have done is put in a bit of a hack. I create a Calculator decorator that takes in the filters on the XamDataGrid as a param. When aggregate is first called it checks the filters on the record's datapresenter and applies the filters from the XamDataGrid if appropriate.
It seems to work fine.
...
private void exporter_SummaryRowExporting(object sender, SummaryRowExportingEventArgs e)
{
summary.Refresh();
calc = new HackCalculatorDecorator (FieldLayouts[0].RecordFilters,
summary.SummaryDefinition.Calculator);
summary.SummaryDefinition.Calculator = calc;
}
private IList<RecordFilter> _filters;
public HackCalculatorDecorator(IList<RecordFilter> filters, SummaryCalculator calc)
_calculator = calc;
_filters = filters;
public override void Aggregate(object dataValue, SummaryResult summaryResult, Record record)
if
(record.DataPresenter.FieldLayouts[0].RecordFilters.Count != _filters.Count)
record.DataPresenter.FieldLayouts[0].RecordFilters.Clear();
foreach (var filter in _filters)
fil.Conditions.Add(cond);
record.DataPresenter.FieldLayouts[0].RecordFilters.Add(fil);
_calculator.Aggregate(dataValue, summaryResult, record);
_calculator.BeginCalculation(summaryResult);
public override bool CanProcessDataType(Type dataType)
return _calculator.CanProcessDataType(dataType);
public override object EndCalculation(SummaryResult summaryResult)
return _calculator.EndCalculation(summaryResult);
public override string Description
get { return _calculator.Description; }
public override string Name
get { return _calculator.Name; }
Hello Alastair,
I have investigated your issue further and it turns out that this behavior occurs only in 10.3 and only when the SummaryDisplayArea is set to Top or TopFixed and since we no longer provide fixes for version 10.3, because it is a retired one, my suggestion is to set the SummaryDisplayArea to Bottom or BottomFixed, or upgrade to version 11.2 where the issue doesn’t occur.
Hope this helps you.
Unfortunately I am stuck with v10.3 at the moment and have no room to upgrade. Is this perhaps a bug that has been since fixed? If so is there a known workaround.
FYI while investigating this I have listened to the SummaryRowExporting event of the DataPresenterExcelExporter and I can see that the summaries are definitely the incorrect values. Is there perhaps any way of fixing this from this event?
Thank you for your post. I have been looking into it and followed your scenario and everything seems to work ok on my side. I can suggest you download the latest service release by logging to our web site and going to My IG \My Keys and Downloads. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.