Skip to content

Commit c54a886

Browse files
authoredOct 31, 2019
Add files via upload
1 parent 4bc72c7 commit c54a886

File tree

3 files changed

+258
-0
lines changed

3 files changed

+258
-0
lines changed
 

‎Aspose.-.Dynamic.DCF.xlsx

10.8 KB
Binary file not shown.

‎Aspose.html

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
<html>
2+
3+
<head>
4+
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
5+
<meta name=ProgId content=Excel.Sheet>
6+
<meta name=Generator content="Microsoft Excel 15">
7+
<style id="Aspose.-.Dynamic.DCF_25127_Styles">
8+
<!--table
9+
{mso-displayed-decimal-separator:"\.";
10+
mso-displayed-thousand-separator:"\,";}
11+
.xl1525127
12+
{padding-top:1px;
13+
padding-right:1px;
14+
padding-left:1px;
15+
mso-ignore:padding;
16+
color:black;
17+
font-size:11.0pt;
18+
font-weight:400;
19+
font-style:normal;
20+
text-decoration:none;
21+
font-family:����;
22+
mso-generic-font-family:auto;
23+
mso-font-charset:134;
24+
mso-number-format:General;
25+
text-align:general;
26+
vertical-align:bottom;
27+
mso-background-source:auto;
28+
mso-pattern:auto;
29+
white-space:nowrap;}
30+
.xl6325127
31+
{padding-top:1px;
32+
padding-right:1px;
33+
padding-left:1px;
34+
mso-ignore:padding;
35+
color:black;
36+
font-size:11.0pt;
37+
font-weight:400;
38+
font-style:normal;
39+
text-decoration:none;
40+
font-family:����;
41+
mso-generic-font-family:auto;
42+
mso-font-charset:134;
43+
mso-number-format:"\#\,\#\#0";
44+
text-align:general;
45+
vertical-align:bottom;
46+
mso-background-source:auto;
47+
mso-pattern:auto;
48+
white-space:nowrap;}
49+
.xl6425127
50+
{padding-top:1px;
51+
padding-right:1px;
52+
padding-left:1px;
53+
mso-ignore:padding;
54+
color:black;
55+
font-size:11.0pt;
56+
font-weight:700;
57+
font-style:normal;
58+
text-decoration:none;
59+
font-family:����;
60+
mso-generic-font-family:auto;
61+
mso-font-charset:134;
62+
mso-number-format:General;
63+
text-align:general;
64+
vertical-align:bottom;
65+
mso-background-source:auto;
66+
mso-pattern:auto;
67+
white-space:nowrap;}
68+
.xl6525127
69+
{padding-top:1px;
70+
padding-right:1px;
71+
padding-left:1px;
72+
mso-ignore:padding;
73+
color:black;
74+
font-size:11.0pt;
75+
font-weight:400;
76+
font-style:normal;
77+
text-decoration:none;
78+
font-family:����;
79+
mso-generic-font-family:auto;
80+
mso-font-charset:134;
81+
mso-number-format:"\#\,\#\#0";
82+
text-align:general;
83+
vertical-align:bottom;
84+
border-top:.5pt solid windowtext;
85+
border-right:none;
86+
border-bottom:2.0pt double windowtext;
87+
border-left:none;
88+
mso-background-source:auto;
89+
mso-pattern:auto;
90+
white-space:nowrap;}
91+
.xl6625127
92+
{padding-top:1px;
93+
padding-right:1px;
94+
padding-left:1px;
95+
mso-ignore:padding;
96+
color:black;
97+
font-size:11.0pt;
98+
font-weight:400;
99+
font-style:normal;
100+
text-decoration:none;
101+
font-family:����;
102+
mso-generic-font-family:auto;
103+
mso-font-charset:134;
104+
mso-number-format:0%;
105+
text-align:general;
106+
vertical-align:bottom;
107+
mso-background-source:auto;
108+
mso-pattern:auto;
109+
white-space:nowrap;}
110+
.xl6725127
111+
{padding-top:1px;
112+
padding-right:1px;
113+
padding-left:1px;
114+
mso-ignore:padding;
115+
color:black;
116+
font-size:11.0pt;
117+
font-weight:400;
118+
font-style:normal;
119+
text-decoration:none;
120+
font-family:����;
121+
mso-generic-font-family:auto;
122+
mso-font-charset:134;
123+
mso-number-format:"_\(* \#\,\#\#0_\)\;_\(* \\\(\#\,\#\#0\\\)\;_\(* \0022-\0022??_\)\;_\(\@_\)";
124+
text-align:general;
125+
vertical-align:bottom;
126+
mso-background-source:auto;
127+
mso-pattern:auto;
128+
white-space:nowrap;}
129+
ruby
130+
{ruby-align:left;}
131+
rt
132+
{color:windowtext;
133+
font-size:9.0pt;
134+
font-weight:400;
135+
font-style:normal;
136+
text-decoration:none;
137+
font-family:����;
138+
mso-generic-font-family:auto;
139+
mso-font-charset:134;
140+
mso-char-type:none;}
141+
.table td{
142+
width:100pt;
143+
}
144+
-->
145+
</style>
146+
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
147+
<script language="javascript">
148+
$(document).ready(function(){
149+
$("#id_submit").click(function() {
150+
data = {}
151+
data.wacc = $("#txt_wacc").val();
152+
data.grouth_rate = $("#txt_growth_rate").val();
153+
data.debt = $("#txt_debt").val();
154+
data.cce = $("#txt_cce").val();
155+
$.ajax({url:"calc", type:"POST",
156+
data: data,
157+
success:function(result) {
158+
var obj=JSON.parse(result);
159+
$("#id_enterprise_value").text(obj["c13"]);
160+
$("#id_debt").text(obj["c14"]);
161+
$("#id_cce").text(obj["c15"]);
162+
$("#id_new_debt").text(obj["c16"]);
163+
$("#id_value").text(obj["c17"]);
164+
}});
165+
});
166+
})
167+
</script>
168+
</head>
169+
170+
<body>
171+
172+
<div id="Aspose.-.Dynamic.DCF_25127" align=center x:publishsource="Excel">
173+
174+
<table border=0 cellpadding=0 cellspacing=0 width=218 style='border-collapse:
175+
collapse;table-layout:fixed;width:163pt' class="table">
176+
<col width=119 style='mso-width-source:userset;mso-width-alt:3808;width:89pt'>
177+
<col width=99 style='mso-width-source:userset;mso-width-alt:3168;width:74pt'>
178+
<tr height=19 style='height:14.25pt;'>
179+
<td height=19 class=xl6425127 width=119 style='height:14.25pt;width:89pt'>WACC</td>
180+
<td class=xl6625127 align=right width=99 style='width:74pt'><input type="text" id="txt_wacc" value="10%" style="width:74pt;text-align: right;"></td>
181+
</tr>
182+
<tr height=19 style='height:14.25pt'>
183+
<td height=19 class=xl6425127 style='height:14.25pt'>Growth rate</td>
184+
<td class=xl6625127 align=right><input type="text" id="txt_growth_rate" value="3%" style="width:74pt;text-align: right;"></td>
185+
</tr>
186+
<tr height=19 style='height:14.25pt'>
187+
<td height=19 class=xl6425127 style='height:14.25pt'>Debt</td>
188+
<td class=xl6725127><input type="text" id="txt_debt" value="8,000,000" style="width:74pt;text-align: right;"></td>
189+
</tr>
190+
<tr height=19 style='height:14.25pt'>
191+
<td height=19 class=xl6425127 style='height:14.25pt'>C&amp;CE</td>
192+
<td class=xl6725127><input type="text" id="txt_cce" value="3,000,000" style="width:74pt;text-align: right;"></td>
193+
</tr>
194+
<tr height=19 style='height:14.25pt'>
195+
<td height=19 class=xl1525127 style='height:14.25pt'></td>
196+
<td class=xl1525127 align=right><input type="button" id="id_submit" value="submit"></td>
197+
</tr>
198+
<tr height=19 style='height:14.25pt'>
199+
<td height=19 class=xl6425127 style='height:14.25pt'>Enterprise value</td>
200+
<td class=xl6325127 align=right id="id_enterprise_value"></td>
201+
</tr>
202+
<tr height=19 style='height:14.25pt'>
203+
<td height=19 class=xl6425127 style='height:14.25pt'>Debt</td>
204+
<td class=xl6325127 align=right id="id_debt"></td>
205+
</tr>
206+
<tr height=19 style='height:14.25pt'>
207+
<td height=19 class=xl6425127 style='height:14.25pt'>C&amp;CE</td>
208+
<td class=xl6325127 align=right id="id_cce"></td>
209+
</tr>
210+
<tr height=19 style='height:14.25pt'>
211+
<td height=19 class=xl6425127 style='height:14.25pt'>Net debt</td>
212+
<td class=xl6325127 align=right id="id_new_debt"></td>
213+
</tr>
214+
<tr height=20 style='height:15.0pt'>
215+
<td height=20 class=xl6425127 style='height:15.0pt'>Value</td>
216+
<td class=xl6525127 align=right id="id_value"></td>
217+
</tr>
218+
<![if supportMisalignedColumns]>
219+
<tr height=0 style='display:none'>
220+
<td width=119 style='width:89pt'></td>
221+
<td width=99 style='width:74pt'></td>
222+
</tr>
223+
<![endif]>
224+
</table>
225+
226+
</div>
227+
228+
</body>
229+
230+
</html>

‎server.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
var express = require("express");
2+
var app = express();
3+
var bodyParser = require("body-parser");
4+
5+
var aspose = aspose || {};
6+
aspose.cells = require("aspose.cells");
7+
8+
app.use(bodyParser.urlencoded({extended: false}));
9+
10+
app.post('/calc', function (req, res) {
11+
var wb = new aspose.cells.Workbook("Aspose.-.Dynamic.DCF.xlsx");
12+
var cells = wb.getWorksheets().get("Sheet1").getCells();
13+
cells.get("C2").putValue(req.body.wacc, true);
14+
cells.get("C3").putValue(req.body.grouth_rate, true);
15+
cells.get("C4").putValue(req.body.debt, true);
16+
cells.get("C5").putValue(req.body.cce, true);
17+
wb.calculateFormula();
18+
r = {}
19+
r["c13"] = cells.get("c13").getStringValue();
20+
r["c14"] = cells.get("c14").getStringValue();
21+
r["c15"] = cells.get("c15").getStringValue();
22+
r["c16"] = cells.get("c16").getStringValue();
23+
r["c17"] = cells.get("c17").getStringValue();
24+
25+
res.end(JSON.stringify(r))
26+
})
27+
28+
app.use(express.static(".")).listen(8080);

0 commit comments

Comments
 (0)