Originally posted by: Redhat11
Hi,
is there a way to assign a dynamic range to SheetRead similiar to how it works with SheetWrite? I do not want to use named ranges in Excel.
Something like:
string outputRange; // = "ScheduledTrips!A:L";
int numRows; // = Shipments.size;
// shipment tuple contains 3 components
{shipment} Shipments = ...;
// postprocessing
execute {
numRows = Shipments.size;
outputRange = "ScheduledTrips!A2:" + "C" + (numRows+1);
writeln(outputRange);
}
just for SheetRead
this is my .dat file. I want to make the range of D depend on nbProdcuts
prepare {
function generateCosts(c, name) {
for(var s=0; s<c.size; s++) {
c[s] = s;
}
return true;
}
}
nbProducts =3;
nbSources =3;
weight = [10];
c = /*[1, 2]
*/
[]
invoke generateCosts
;
SheetConnection sheet("sourcing_reduced_sheet.xls");
D from SheetRead(sheet,"'demand'!A2:A3");
B from SheetRead(sheet, "'stock'!A2:B3");
Thanks!
#DecisionOptimization#OPLusingCPLEXOptimizer