Solved

Hot to calculate sum of a range in a spreadsheet using OWC

Posted on 2004-10-20
4
508 Views
Last Modified: 2012-06-21
Hello,

I am using Office Web Component to populate a spreadsheet within ASP.net. the spreadsheet contains numerous figures. What I need to do is create a grand total line within the spreadhseet.
Can any one tell me how to do this  dynamically? the number of rows within the spreadsheet may vary over time depending on the results of the query

Thanks In Advance

0
Comment
Question by:anwarmir
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Accepted Solution

by:
oliviersanzot earned 300 total points
ID: 12358995
Hi,

I'm using owc10 from a VB6 app, I guess there are not much differences from ASP.
This sample will create a formula in cell(1,1) of a worksheet :
sheet1.Cells(1,1).formulalocal="=SUM(D5:D10)"

I would do something like this :

1. Get Start Row
Loop until recordset.eof
    Add a row
end loop
Get End Row

2. Create a formula string "=SUM(xx:yy)"

3. Assign Formula.

I guess that knowing start row and end row of the range you want to sum, you could easily create the formula string replacing the column index by its corresponding letter.
Hope this helps,

Olivier
0
 

Author Comment

by:anwarmir
ID: 12443240
Sorry for the delay getting back to you...The solution provided works fine. Thanks..
However I have a one more question do you know how to wrap text using OWC has I nedd to fit my whole sheet on the Screen ?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question