User Tools

Site Tools


interfaces:writing_data_to_a_spreadsheet_and_keeping_control_over_the_area_used

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
interfaces:writing_data_to_a_spreadsheet_and_keeping_control_over_the_area_used [2008/07/26 07:13]
support
interfaces:writing_data_to_a_spreadsheet_and_keeping_control_over_the_area_used [2020/05/26 11:11] (current)
Frederik Fiand
Line 1: Line 1:
-====== Writing data to spreadsheet and keeping control over the area used ====== +====== Writing data to an Excel spreadsheet and keeping control over the area used ====== 
-We want to write a parameter to sheet, but keep control over the area used.+We want to write a parameter to an Excel sheet using [[https://​www.gams.com/​latest/​docs/​T_GDXXRW.html|GDXXRW]], but keep control over the area used.
 When one uses the top left cell for the range, cells to the right and down are cleared. When one uses the top left cell for the range, cells to the right and down are cleared.
 If one specifies a range, it may be too large or too small. The code below creates If one specifies a range, it may be too large or too small. The code below creates
-a range that is sized exactly. The example also demonstrated the usage of xlstalk, ​+a range that is sized exactly. The example also demonstrated the usage of [[https://​www.gams.com/​latest/​docs/​T_XLSTALK.html|xlstalk]]
 which was introduced in distribution 22.8 which was introduced in distribution 22.8
 <​code>​ <​code>​
Line 24: Line 24:
 cstart('​D','​3'​) = yes; cstart('​D','​3'​) = yes;
 loop(cstart(c,​r),​ loop(cstart(c,​r),​
-      ​cend(c+Card(j),​r+Card(i)) = cstart(c,​r) +  ​cend(c+Card(j),​r+Card(i)) = cstart(c,​r) 
-     ​);+); 
 +  ​
 file pv /pv.txt/; file pv /pv.txt/;
 put pv; put pv;
Line 32: Line 33:
 loop(cend(c,​r),​ put c.tl:0, r.tl:0); loop(cend(c,​r),​ put c.tl:0, r.tl:0);
 putclose; putclose;
-* note:  xlstalk ​is new for the 22.8 release (save/close the file and open file)+* note:  xlstalk ​has been introduced in the 22.8 release (save/close the file and open file)
 execute '​xlstalk.exe -s pv.xls';​ execute '​xlstalk.exe -s pv.xls';​
 execute '​gdxxrw pv.gdx o=pv.xls par=A rng=@pv.txt cdim=1 rdim=1';​ execute '​gdxxrw pv.gdx o=pv.xls par=A rng=@pv.txt cdim=1 rdim=1';​
 execute '​xlstalk.exe -o pv.xls'​ execute '​xlstalk.exe -o pv.xls'​
 </​code>​ </​code>​
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY interfaces/writing_data_to_a_spreadsheet_and_keeping_control_over_the_area_used.txt · Last modified: 2020/05/26 11:11 by Frederik Fiand