Jankya
Jankya

Reputation: 958

SpreadsheetGear Column Sum Calculation

Is it possible to set the Formula on Column First Say "=SUM(A1:A10)" and after that Display the value in A1 to A10 Cells and after that do the calculation.

Upvotes: 4

Views: 1687

Answers (2)

Jankya
Jankya

Reputation: 958

Yes i gets the answer. While Doing some R N D for that i realized that the Furmula operatiion is not work with :

SpreadsheetGear.IRange range = WorkBookViewForData.ActiveWorksheet.Cells["A10"];
range.Formula = "=SUM(A1:A9)"
SpreadsheetGear.IRange range1 = WorkBookViewForData.ActiveWorksheet.Cells["A1"];
range1.value = "1"
SpreadsheetGear.IRange range2 = WorkBookViewForData.ActiveWorksheet.Cells["A2"];
range2.value = "2"
SpreadsheetGear.IRange range3 = WorkBookViewForData.ActiveWorksheet.Cells["A3"];
range3.value = "3"

But works with

   SpreadsheetGear.IRange range = WorkBookViewForData.ActiveWorksheet.Cells["A10"];
    range.Formula = "=SUM(A1:A9)"             
     WorkBookViewForData.ActiveWorksheet.Cells["A1"].Value="1";
        WorkBookViewForData.ActiveWorksheet.Cells["A2"].Value="2";
        WorkBookViewForData.ActiveWorksheet.Cells["A3"].Value="3";

where WorkBookViewForData is the name of the SpreadsheetGear Control

Upvotes: 1

Freelancer
Freelancer

Reputation: 9074

Try to use following:

totalCell.Formula = "=SUM(C6,C11,C16,C21)";

Go through following link for detailed code:

http://www.spreadsheetgear.com/support/samples/srcview.aspx?file=outline.aspx

Hope its helpful.

Upvotes: 0

Related Questions