static void nestingExcel(Args _args)
{
SysExcelStyles styles;
SysExcelStyle style;
SysExcelFont font;
#AviFiles
SysOperationProgress progress = new SysOperationProgress();
SysExcelApplication sysExcelApplication;
SysExcelWorkbooks sysExcelWorkBooks;
SysExcelWorkbook sysExcelWorkBook;
SysExcelWorkSheets sysExcelWorkSheets;
SysExcelWorkSheet sysExcelWorkSheet;
TvItemscrTable scrTable;
TvItemScrapLInes scrLines;
TvProdProfiles prodProfiles;
int j,k;
int len[];
;
sysExcelApplication = SysExcelApplication::construct();
sysExcelWorkBooks = sysExcelApplication.workbooks();
sysExcelWorkBook = sysExcelWorkBooks.add();
styles = sysExcelWorkBook.styles();
style = styles.add("Header");
font = style.font();
font.bold(true);
font.color(255);
sysExcelWorkSheets = sysExcelWorkbook.worksheets();
sysExcelWorkSheet = sysExcelWorkSheets.add(null,null,1);
sysExcelWorkSheet = sysExcelWorkSheets.add();
sysExcelWorkSheet.name('PayRegister');
sysExcelWorksheet.cells().item(1,1).value('ItemId');
sysExcelWorksheet.cells().item(1,2).value('NoOfPieces');
sysExcelWorksheet.cells().item(1,3).value('scrap%');
sysExcelWorksheet.cells().item(1,4).value('combination');
sysExcelWorksheet.cells().item(1,5).value('selected');
sysExcelWorksheet.cells().item(1,6).value('Generated');
j=7;
while select prodProfiles order by ItemLength where prodProfiles.salesid == 'SO-100402'
&& prodProfiles.ItemId == 'MSA05005'
{
sysExcelWorksheet.cells().item(1,j).value(prodProfiles.ItemLength);
len[prodProfiles.ItemLength] = j;
j++;
}
sysExcelWorksheet.rows().item(1).style("Header");
sysExcelWorksheet.columns().autoFit();
sysExcelApplication.displayAlerts(false);
sysExcelApplication.visible(true);
k =2;
while select scrTable order by LineNum where scrTable.ItemId == 'MSA05005'
&& scrTable.SalesId == 'SO-100402'
&& scrTable.Selected == noyes::Yes
{
sysExcelWorksheet.cells().item(k,1).value(scrTable.ItemId);
sysExcelWorksheet.cells().item(k,2).value(scrTable.NoOfPieces);
sysExcelWorksheet.cells().item(k,3).value(scrTable.ScrapPercent);
sysExcelWorksheet.cells().item(k,4).value(scrTable.NoOfCombinations);
sysExcelWorksheet.cells().item(k,5).value(enum2str(scrTable.Selected));
sysExcelWorksheet.cells().item(k,6).value(enum2str(scrTable.Generated));
while select scrLines where scrLines.ItemId == 'MSA05005'
&& scrLines.SalesId == 'SO-100402'
&& scrLines.RefLineNum == scrTable.LineNum
{
sysExcelWorksheet.cells().item(k,len[scrLines.Length]).value(scrLines.NoOfPieces);
}
k++;
}
}
{
SysExcelStyles styles;
SysExcelStyle style;
SysExcelFont font;
#AviFiles
SysOperationProgress progress = new SysOperationProgress();
SysExcelApplication sysExcelApplication;
SysExcelWorkbooks sysExcelWorkBooks;
SysExcelWorkbook sysExcelWorkBook;
SysExcelWorkSheets sysExcelWorkSheets;
SysExcelWorkSheet sysExcelWorkSheet;
TvItemscrTable scrTable;
TvItemScrapLInes scrLines;
TvProdProfiles prodProfiles;
int j,k;
int len[];
;
sysExcelApplication = SysExcelApplication::construct();
sysExcelWorkBooks = sysExcelApplication.workbooks();
sysExcelWorkBook = sysExcelWorkBooks.add();
styles = sysExcelWorkBook.styles();
style = styles.add("Header");
font = style.font();
font.bold(true);
font.color(255);
sysExcelWorkSheets = sysExcelWorkbook.worksheets();
sysExcelWorkSheet = sysExcelWorkSheets.add(null,null,1);
sysExcelWorkSheet = sysExcelWorkSheets.add();
sysExcelWorkSheet.name('PayRegister');
sysExcelWorksheet.cells().item(1,1).value('ItemId');
sysExcelWorksheet.cells().item(1,2).value('NoOfPieces');
sysExcelWorksheet.cells().item(1,3).value('scrap%');
sysExcelWorksheet.cells().item(1,4).value('combination');
sysExcelWorksheet.cells().item(1,5).value('selected');
sysExcelWorksheet.cells().item(1,6).value('Generated');
j=7;
while select prodProfiles order by ItemLength where prodProfiles.salesid == 'SO-100402'
&& prodProfiles.ItemId == 'MSA05005'
{
sysExcelWorksheet.cells().item(1,j).value(prodProfiles.ItemLength);
len[prodProfiles.ItemLength] = j;
j++;
}
sysExcelWorksheet.rows().item(1).style("Header");
sysExcelWorksheet.columns().autoFit();
sysExcelApplication.displayAlerts(false);
sysExcelApplication.visible(true);
k =2;
while select scrTable order by LineNum where scrTable.ItemId == 'MSA05005'
&& scrTable.SalesId == 'SO-100402'
&& scrTable.Selected == noyes::Yes
{
sysExcelWorksheet.cells().item(k,1).value(scrTable.ItemId);
sysExcelWorksheet.cells().item(k,2).value(scrTable.NoOfPieces);
sysExcelWorksheet.cells().item(k,3).value(scrTable.ScrapPercent);
sysExcelWorksheet.cells().item(k,4).value(scrTable.NoOfCombinations);
sysExcelWorksheet.cells().item(k,5).value(enum2str(scrTable.Selected));
sysExcelWorksheet.cells().item(k,6).value(enum2str(scrTable.Generated));
while select scrLines where scrLines.ItemId == 'MSA05005'
&& scrLines.SalesId == 'SO-100402'
&& scrLines.RefLineNum == scrTable.LineNum
{
sysExcelWorksheet.cells().item(k,len[scrLines.Length]).value(scrLines.NoOfPieces);
}
k++;
}
}
No comments:
Post a Comment