We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change Totals formula with Template Marker

Thread ID:

Created:

Updated:

Platform:

Replies:

116104 Apr 3,2014 12:40 AM UTC Apr 3,2014 01:17 PM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: XlsIO
Benjamin Rogers
Asked On April 3, 2014 12:40 AM UTC

I have a spreadsheet where I am using Template Markers. It is being populated correctly. However I have a Summary Total cell that I want to sum values of all the rows. I need this to be dynamically set by the Template Markers. Eg: If there are three rows in the data table used to populate Template Markers I need the totals formula to be set to =SUM(H6:H8). If there are 5 rows on the data table I need the totals formula to be set to =SUM(H6:H10). Row 6 is the start row. That is the one with all the marker variables such as %MediaSchedule.PlanCode. Is there anyway to do this with Template Markers? That is dynamically set the end row of the totals formula based on the number of rows in the data table. Attached is a results spreadsheet. The cell H11 has the totals formula. It is =SUM(H6:H6). I need it to be =SUM(H6:H8) for this example.


Attachment: MarkerFile635321162330426863_b9dcd64a.zip

Prasanth M [Syncfusion]
Replied On April 3, 2014 01:17 PM UTC

Hi Benjamin,

Thank you for using Syncfusion products.

Currently our XlsIO does not support to dynamically change formula with Template Marker. However you can work around by using UsedRange property after the ApplyMarker method invocation. We have shared the code snippet for your reference.


Code Snippet:

marker.ApplyMarker();

int lastRow=sheet.UsedRange.LastRow;

sheet["H11"].Formula = string.Format("SUM(H6:H{0})",(lastRow - 3));


Please let us know if you need any clarification.

Regards,
Prasanth


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;