Цитата:
Сообщение от
kashperuk
а как именно вставляете данные?
Там обычно во всех методах вставки есть доп. параметр, имеющий по умолчанию значение 1 - _workSheet
Так вот, надо передать туда НЕ 1
X++:
void writeReport()
{
inventIdExistsInStockInOutTmp _inventIdExistsInStockInOutTmp;
ComExcelDocument_ru ru;
filepath templatefile;
InventTableSellout _InventTableSellout;
int i = 11;
Array myArray;
;
this.insertExistingItemIdInTmpTable(_inventIdExistsInStockInOutTmp);
ru = new ComExcelDocument_ru();
templatefile = Xinfo::directory(directoryType::Include) + "template\\file.xls";
myArray = new array(Types::Class);
if(ru.newFile(templatefile,true))
{
while select A_PartNumber, sum(inQty), sum(outQty), sum(stockQty), sum(Transit) ,maxof(ItemId), sum(LastPeriodStockQty)
from _inventIdExistsInStockInOutTmp
group by A_PartNumber
/*
where (_inventIdExistsInStockInOutTmp.stockQty > 0
|| _inventIdExistsInStockInOutTmp.Transit > 0
|| _inventIdExistsInStockInOutTmp.LastPeriodStockQty > 0)
*/
{
ru.insertRow(i);
myArray.value(1, comvariant::createFromStr(_inventIdExistsInStockInOutTmp.A_PartNumber));
myArray.value(2, comvariant::createFromStr(InventTable::find(_inventIdExistsInStockInOutTmp.ItemId).NameAlias));
myArray.value(3, comvariant::createFromStr(InventTable::find(_inventIdExistsInStockInOutTmp.ItemId).ItemName));
myArray.value(4, comvariant::createFromReal(_inventIdExistsInStockInOutTmp.LastPeriodStockQty));
myArray.value(5, comvariant::createFromReal(_inventIdExistsInStockInOutTmp.inQty));
myArray.value(6, comvariant::createFromReal(-_inventIdExistsInStockInOutTmp.outQty));
myArray.value(7, comvariant::createFromReal(_inventIdExistsInStockInOutTmp.stockQty));
myArray.value(8, comvariant::createFromReal(_inventIdExistsInStockInOutTmp.Transit));
ru.insertValue(strfmt("A%1:H%1",i),comvariant::createFromArray(myArray),1);
i++;
}
}
}