.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Others >> Post New QuestionBookmark and Share Subscribe to Forum

sum formula is not working in GrapeCity fpspread cell

Posted By: Santosh     Posted Date: June 09, 2011    Points:5   Category :Others
hi
i m working on GrapeCity farpoint to generate the excel report without microsoft excel.

i want to use some formula in for calculation so i have a excel sheet having formula so i just binded excel sheet to fpspread but all the formula is working like divide etc but where ever excel sheet contains sum formula is not working.

so any boby tell me why sum is not woring,just i want to put some for first three cell and show in 4th cell.

it's very urgent


thanx
santosh

Responses
Author: Gowthammanju             
Posted Date: June 09, 2011     Points: 20   

use following code to save farpoint spread sheet to excel as



FarPoint.Win.Spread.SheetView shv = new FarPoint.Win.Spread.SheetView();
DialogResult dlg;
fpSpread1.Location = new Point(10, 10);
fpSpread1.Height = 200;
fpSpread1.Width = 400;
Controls.Add(fpSpread1);
fpSpread1.Sheets.Add(shv);
fpSpread1.ActiveSheet.ColumnCount = 4;
fpSpread1.ActiveSheet.RowCount = 4;
string fileName;
fileName = "..\\..\\bin\\savespreadstream.xls";
dlg = MessageBox.Show("Do you want to save to an Excel-formatted file??", "SaveExcel", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)

{
fpSpread1.ActiveSheet.SetValue(0, 0, 20);
fpSpread1.ActiveSheet.SetValue(1, 0, 30);
fpSpread1.ActiveSheet.SetFormula(2, 2, "Sum(A1,A2)");
fpSpread1.SaveExcel(fileName);
}



the formula used for excel sum purpose is



The same formula, written using the SUM function would be: 
= SUM(B7 : B10)


Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Gowthammanju             
Posted Date: June 09, 2011     Points: 20   

Ply read the following reference file at



http://www.evget.com/zh-CN/product/835/feature_en.aspx

Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Santosh             
Posted Date: June 09, 2011     Points: 20   

hi Gowthammanju
i have the excel sheet contains sum formula and i m just binding that excel sheet to the fpspread.

like D cell contains the formula sum(A,B,C)
and throught coce i m writing in A,B and C cell of fpspread and after that automatically D should show the sum of (A,B,C)

Regards
Santosh

Author: Santosh             
Posted Date: June 10, 2011     Points: 20   

hi Gowthammanju
may be u r right..
so can u plz tell me how to convert cell type from string to integer type after binding the excel into fpspread

regards
santosh



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend