any ideas ?

mad_schatz

Member
Joined
Jan 1, 2009
Messages
15
Programming Experience
1-3
Hello Gents,

I have to prepare a little application which I don't have idea how to accomplish that.And don't wanna use any excel automation to do it.

I have a excel page that needs to be converted to VB.NET. Here is an example :


A..................................B
-----------------------------
1.Item Name..................Sugar
2.Item Count in Box.........6
3.Item Price...................3 per Item
4.QTY...........................10
5.Total..........................= B2*B3*B4 (Excel Formula)
6.VAT...........................10%
7.COST.........................=B5*B6

Now, this list may got bigger. So I'll save them in a Access Table.
My problem is I need to give the user the ability to change the formula and when new lines added I want to give the user to be able to define new formulas.

So I got stuck on the handling the formulas. If it was a fixed list I caould handle it on variables but when it is a dynamic list, I'm out of ideas.

Any ideas welcome,

Cheers,
 
In non programming terms, what is the forumla?

Isn't it: total = Count times Price times Quantity?

Why can't you use variables for that?
 
I'll try to explain better what do I need and where do I get stuck. Here is the the first part of the excel file that I'm working on it.



This sheet is the template sheet. So when ever it is needed a new copy is created and the calculation is added to archive.

What I have in mind :
First of all, I'm thinking to create a a data grid where user will define the contents of the template with the formulas. The template table will contain the formulas needed to calculate the respective cells. For example :
For "Fabric Price Each Garment" line will contain the calculation formulas which is B2*B9.
These information will be kept in a table in database. In case if needed user can easily update the template and add new lines and new formulas corresponding.

The point I get stuck :
Actually I'm having difficulties to figure out how to apply the formula part.
If the the template was a fixed template (where user has no ability to edit/change) there I can create local variables and calculate the formula.

But when it is a dynamic template I will not be able to use any hard coded varibales as in case when a new line added to the template I need to hardcode the new line variable.

At this point I'm thinking to use a dynamic LIST or Dictionary to hold the template and its data entered by the user. But How should I prepare the formula stuff. How can I convert the formula where B2*B9 calculation will be done.

Really appreciate for any ideas.
 
Back
Top