Exportfile for AOT version 1.0 or later Formatversion: 1 ***Element: MNU ; Microsoft Dynamics AX Menu : LabelTools unloaded ; -------------------------------------------------------------------------------- MNUVERSION 4 MENU #LabelTools PROPERTIES Name #LabelTools Label #@SYS25058 HelpText #@SYS69706 SetCompany #Yes ENDPROPERTIES MENUITEM PROPERTIES Name #Beschriftungs-Editor MenuItemName #SysLabelSearch ENDPROPERTIES ENDMENUITEM MENUITEM PROPERTIES Name #Beschriftungsprotokoll MenuItemName #SysLabelHistory ENDPROPERTIES ENDMENUITEM MENUITEM PROPERTIES Name #Beschriftungsdatei-Assistent MenuItemName #SysLabelFileWizard ENDPROPERTIES ENDMENUITEM MENUITEM PROPERTIES Name #Beschriftungsintervalle MenuItemName #SysLabelInterval ENDPROPERTIES ENDMENUITEM MENU #@SYS95611 PROPERTIES Name #Submenu1 Label #@SYS95611 ENDPROPERTIES MENUITEM PROPERTIES Name #Auslesen MenuItemType #Action MenuItemName #DEV_LabelFileToExcel ENDPROPERTIES ENDMENUITEM MENUITEM PROPERTIES Name #Einlesen MenuItemType #Action MenuItemName #DEV_LabelFileFromExcel ENDPROPERTIES ENDMENUITEM ENDMENU ENDMENU ***Element: FTM ; Microsoft Dynamics AX MENUITEM : DEV_LabelFileToExcel unloaded ; -------------------------------------------------------------------------------- VERSION 1 MENUITEM #DEV_LabelFileToExcel Type: 3 PROPERTIES Name #DEV_LabelFileToExcel Label #@SYS76585 ObjectType #Class Object #DEV_LabelFileToExcel ENDPROPERTIES ENDMENUITEM ***Element: FTM ; Microsoft Dynamics AX MENUITEM : DEV_LabelFileFromExcel unloaded ; -------------------------------------------------------------------------------- VERSION 1 MENUITEM #DEV_LabelFileFromExcel Type: 3 PROPERTIES Name #DEV_LabelFileFromExcel Label #@SYS8494 ObjectType #Class Object #DEV_LabelFileFromExcel ENDPROPERTIES ENDMENUITEM ***Element: CLS ; Microsoft Dynamics AX Class: DEV_LabelLineSplitted nicht geladen ; -------------------------------------------------------------------------------- CLSVERSION 1 CLASS #DEV_LabelLineSplitted PROPERTIES Name #DEV_LabelLineSplitted Extends #Object RunOn #Called from ENDPROPERTIES METHODS Version: 3 SOURCE #addLabelLine #protected void addLabelLine(str _labelLine, labelModuleId _moduleId) #{ # ; # if (Global::strStartsWith(_labelLine, '@' + _moduleId)) # { # labelId = substr(_labelLine, 1, strscan(_labelLine, ' ', 1, strlen(_labelLine)) -1); # labelExpression = substr(_labelLine, strlen(labelId) + 2, strlen(_labelLine)); # } # else # { # labelDescription = _labelLine; # } #} ENDSOURCE SOURCE #classDeclaration #class DEV_LabelLineSplitted extends Object #{ # LabelId labelId; # str labelExpression; # str labelDescription; #} ENDSOURCE SOURCE #decription #public str decription() #{ # return labelDescription; #} ENDSOURCE SOURCE #expression #public str expression() #{ # return labelExpression; #} ENDSOURCE SOURCE #labelId #public labelId labelId() #{ # return labelId; #} ENDSOURCE SOURCE #labelNo #public int labelNo() #{ # int ret; # str numStr = strkeep(this.labelId(), '0123456789'); # ret = str2int(numStr); # return ret; #} ENDSOURCE SOURCE #new #protected void new() #{ # ; # super(); // TODO extend this class to object #} ENDSOURCE SOURCE #constructLine #public static DEV_LabelLineSplitted constructLine(str _labelLine, LabelModuleId _moduleId) #{ # DEV_LabelLineSplitted dEV_LabelLineSplitted = new DEV_LabelLineSplitted(); # ; # dEV_LabelLineSplitted.addLabelLine(_labelLine, _moduleId); # return dEV_LabelLineSplitted; #} ENDSOURCE ENDMETHODS ENDCLASS ***Element: CLS ; Microsoft Dynamics AX Class: DEV_LabelFile nicht geladen ; -------------------------------------------------------------------------------- CLSVERSION 1 CLASS #DEV_LabelFile PROPERTIES Name #DEV_LabelFile Extends #RunBase RunOn #Called from ENDPROPERTIES METHODS Version: 3 SOURCE #actionCaption #abstract protected Caption actionCaption() #{ #} ENDSOURCE SOURCE #buildLabelFileName #protected FileName buildLabelFileName(labelModuleId _labelModule, LanguageId _language) #{ # return 'ax' + strupr(_labelModule) + strlwr(_language) + #ald; #} ENDSOURCE SOURCE #caption #public ClassDescription caption() #{ # return strfmt('%1: %2', "@SYS25058", this.actionCaption()); #} ENDSOURCE SOURCE #classDeclaration #abstract class DEV_LabelFile extends RunBase #{ # #define.ald('.ald') # #define.xls('.xls') # #define.xlsx('.xlsx') # #define.xlsb('.xlsb') # #define.xlsm('.xlsm') # #define.xlsh('.xlshtml') # #define.xls_labelCol('A') # #define.xls_templateExpressionCol('B') # #define.xls_templateDescriptionCol('C') # #define.xls_translationExpressionCol('D') # #define.xls_translationDescriptionCol('E') # #define.xls_titleRow(1) # #define.xls_subTitleRow(2) # #define.xls_translationBeginRow(3) # # #File # # DialogField dfExcelFileName; # DialogField dfLabelPathName; # DialogField dfLabelModuleId; # DialogField dfLanguageTemplate; # DialogField dfLanguageTranslation; # # DialogGroup dgLanguage; # DialogGroup dgLabelFileClientAccess; # DialogGroup dgServerGrp; # DialogGroup dgNewExcelGrp; # # FilePath labelPathName; # FileName excelFileName; # LabelModuleId labelModuleId; # LanguageId languageIdTemplate; # LanguageId languageIdTranslation; # boolean labelFileClientAccess; # # #define.CurrentVersion(1) # #localmacro.CurrentList # excelFileName, # labelPathName, # labelModuleId, # languageIdTemplate, # languageIdTranslation, # labelFileClientAccess # #endmacro #} ENDSOURCE SOURCE #colId #protected str colId(str _colId, str _toColId = '') #{ # str ret; # if (_toColId) # { # ret = strfmt('%1:%2', _colId, _toColId); # } # else # { # ret = strfmt('%1:%2', _colId, _colId); # } # return ret; #} ENDSOURCE SOURCE #dialog #protected Object dialog(DialogRunbase dialog, boolean forceOnClient) #{ # DialogGroup dgLabelFileDir; # DialogGroup dgExcelFileSrc; # DialogGroup dialoGroup; # DialogRunbase ret; # # ret = super(dialog, forceOnClient); # # dgExcelFileSrc = ret.addGroup(this.excelFileRole()); # dgExcelFileSrc.frameType(FormFrameType::Edged3D); # dgExcelFileSrc.widthMode(FormWidth::ColumnWidth); # dgNewExcelGrp = ret.addGroup("@SYS92308", dgExcelFileSrc); # dgNewExcelGrp.frameOptionButton(FormFrameOptionButton::Radio); # dgNewExcelGrp.optionValue(excelFileName ? 0 : 1); # dgNewExcelGrp.hideIfEmpty(false); # dialoGroup = ret.addGroup("@SYS95668", dgExcelFileSrc); # dialoGroup.frameOptionButton(FormFrameOptionButton::Radio); # dialoGroup.optionValue(excelFileName ? 1 : 0); # dfExcelFileName = ret.addFieldValue(typeid(FilenameOpen), excelFileName, WinAPI::fileType(#xls)); # # # dgLabelFileDir = ret.addGroup(this.labelFileRole()); # dgLabelFileDir.frameType(FormFrameType::Edged3D); # dgLabelFileDir.widthMode(FormWidth::ColumnWidth); # dgServerGrp = ret.addGroup(strfmt('%1 (%2/%3)', "@SYS108775", "@SYS70308", "@SYS68867"), dgLabelFileDir); # dgServerGrp.frameOptionButton(FormFrameOptionButton::Radio); # dgServerGrp.hideIfEmpty(false); # dgLabelFileClientAccess = ret.addGroup(strfmt('%1 (%2)', "@SYS108775", "@SYS7444"), dgLabelFileDir); # dgLabelFileClientAccess.frameOptionButton(FormFrameOptionButton::Radio); # dfLabelPathName = ret.addFieldValue(typeid(FilePath), labelPathName); # # ret.addGroup("@SYS25058"); # dfLabelModuleId = ret.addFieldValue(typeid(LabelModuleId), labelModuleId); # # dgLanguage = ret.addGroup("@SYS66040"); # dfLanguageTemplate = ret.addFieldValue(typeid(LanguageId), languageIdTemplate, "@SYS53423"); # dfLanguageTranslation = ret.addFieldValue(typeid(LanguageId), languageIdTranslation, "@SYS40253"); # # ret.filenameLookupFilter(["@SYS95611", #AllFilesName + #xls + ';' + # #AllFilesName + #xlsx + ';' + # #AllFilesName + #xlsm + ';' + # #AllFilesName + #xlsb + ';' + # #AllFilesName + #xlsb + ';' + # #AllFilesName + #xlsh, # "@SYS54806", #AllFiles]); # # return ret; #} ENDSOURCE SOURCE #excelFile #protected SysExcelWorksheet excelFile(SysExcelApplication _excelApplication) #{ # SysExcelWorkbooks workBooks; # SysExcelWorkbook workBook; # SysExcelWorksheets workSheets; # SysExcelWorksheet workSheet; # # ; # workBooks = _excelApplication.workbooks(); # if (excelFileName) # { # workBooks.open(excelFileName); # workBook = workBooks.item(1); # workSheets = workBook.worksheets(); # workSheet = workSheets.itemFromNum(1); # } # else # { # workBook = workBooks.add(); # workSheet = workBook.worksheets().add(); # } # return workSheet; #} ENDSOURCE SOURCE #excelFileRole #abstract protected Caption excelFileRole() #{ #} ENDSOURCE SOURCE #getFromDialog #public boolean getFromDialog() #{ # boolean ret; # # ret = super(); # # # if (dgNewExcelGrp.optionValue()) # { # excelFileName = ''; // make a new file # } # else # { # excelFileName = dfExcelFileName.value(); # } # # labelPathName = dfLabelPathName.value(); # labelModuleId = dfLabelModuleId.value(); # languageIdTemplate = dfLanguageTemplate.value(); # languageIdTranslation = dfLanguageTranslation.value(); # labelFileClientAccess = dgLabelFileClientAccess.optionValue(); # # return ret; #} ENDSOURCE SOURCE #labelFile #protected TextBuffer labelFile(labelModuleId _moduleId, LanguageId _language) #{ # TextBuffer ret; # # if (labelFileClientAccess) # { # ret = DEV_LabelFile::clientLabelFile(labelPathName, this.buildLabelFileName(_moduleId, _language)); # } # else # { # ret = DEV_LabelFile::serverLabelFile(this.buildLabelFileName(_moduleId, _language)); # } # return ret; #} ENDSOURCE SOURCE #labelFileRole #abstract protected Caption labelFileRole() #{ #} ENDSOURCE SOURCE #pack #public container pack() #{ # //no super() - parent's method is abstract # return [#CurrentVersion, #CurrentList]; #} ENDSOURCE SOURCE #rangeId #protected str rangeId(str _colId, int _rowId, str _toColId = '', int _toRowId = 0) #{ # str rowIdStr = _rowId ? int2str(_rowId) : ''; # str toRowIdStr = _toRowId ? int2str(_toRowId) : ''; # str ret; # # ; # if (_toColId || toRowIdStr) # { # ret = strfmt('%1%2:%3%4', _colId, rowIdStr, _toColId, toRowIdStr); # } # else # { # ret = strfmt('%1%2', _colId, rowIdStr); # } # return ret; #} ENDSOURCE SOURCE #run #public void run() #{ # super(); #} ENDSOURCE SOURCE #setCellColor #protected void setCellColor(SysExcelRange _range, int _colorIdx) #{ # Com comObject; # ComVariant comVariant; # ; # comObject = _range.comObject(); # comObject = comObject.interior(); # comVariant = new ComVariant(); # comVariant.int(_colorIdx); # comObject.color(comVariant); # comVariant.int(1); # comObject.pattern(comVariant); # #} ENDSOURCE SOURCE #setCellColorClear #protected void setCellColorClear(SysExcelRange _range) #{ # Com comObject; # ComVariant comVariant; # ; # comObject = _range.comObject(); # comObject = comObject.interior(); # comVariant = new ComVariant(); # comVariant.int(-4142); # comObject.pattern(comVariant); # #} ENDSOURCE SOURCE #setCellColorLightBlue #protected void setCellColorLightBlue(SysExcelRange _range) #{ # this.setCellColor(_range, WinAPI::rgb2int(0, 170, 255)); #} ENDSOURCE SOURCE #setCellColorOrange #protected void setCellColorOrange(SysExcelRange _range) #{ # this.setCellColor(_range, WinAPI::rgb2int(255, 170, 0)); #} ENDSOURCE SOURCE #setCellColorRed #protected void setCellColorRed(SysExcelRange _range, int _colorIdx) #{ # this.setCellColor(_range, WinAPI::rgb2int(255, 0, 0)); #} ENDSOURCE SOURCE #setCellColorYellow #protected void setCellColorYellow(SysExcelRange _range) #{ # this.setCellColor(_range, WinAPI::rgb2int(255, 255, 0)); #} ENDSOURCE SOURCE #unpack #public boolean unpack(container _packedClass) #{ # Version version = RunBase::getVersion(_packedClass); # boolean ret; # ; # # //no super() - parent's method is abstract # # switch(version) # { # case #currentVersion: # [version, #currentList]= _packedClass; # ret = true; # } # # return ret; #} ENDSOURCE SOURCE #validate #public boolean validate(Object calledFrom) #{ # boolean ret; # # ret = super(calledFrom); # # if (labelFileClientAccess) # { # if (! labelPathName) # { # ret = checkFailed(strfmt("@SYS26332", strfmt('%1 (%2)', "@SYS26604", enum2str(DirectoryType::Appl)))); # } # } # # if (! labelModuleId) # { # ret = checkFailed(strfmt("@SYS26332", new DictType(extendedTypeNum(LabelModuleId)).label())); # } # # return ret; #} ENDSOURCE SOURCE #clientLabelFile #static client TextBuffer clientLabelFile(FilePath _labelPath, FileName _baseFileName) #{ # TextBuffer textBuffer = new TextBuffer(); # ; # textBuffer.fromFile(_labelPath + @'\' + _baseFileName); # return textBuffer; # #} ENDSOURCE SOURCE #serverLabelFile #static server TextBuffer serverLabelFile(FileName _baseFileName) #{ # FileIOPermission fileIOPermission; # TextBuffer textBuffer = new TextBuffer(); # # FileName fileName = xinfo::directory(DirectoryType::Appl) + @'\' + _baseFileName; # ; # # fileIOPermission = new FileIOPermission(fileName, #io_read); # fileIOPermission.assert(); # textBuffer.fromFile(fileName); # return textBuffer; # #} ENDSOURCE ENDMETHODS ENDCLASS ***Element: CLS ; Microsoft Dynamics AX Class: DEV_LabelFileFromExcel nicht geladen ; -------------------------------------------------------------------------------- CLSVERSION 1 CLASS #DEV_LabelFileFromExcel PROPERTIES Name #DEV_LabelFileFromExcel Extends #DEV_LabelFile RunOn #Called from ENDPROPERTIES METHODS Version: 3 SOURCE #actionCaption #protected Caption actionCaption() #{ # //no super() - parent's method is abstract # return "@SYS1052"; #} ENDSOURCE SOURCE #classDeclaration #class DEV_LabelFileFromExcel extends DEV_LabelFile #{ #} ENDSOURCE SOURCE #dialog #protected Object dialog(DialogRunbase dialog, boolean forceOnClient) #{ # #ResAppl # DialogWindow dWin; # DialogRunbase ret; # # ret = super(dialog, forceOnClient); # # dgNewExcelGrp.visible(false); // does not make sense, an existing excel file is needed # dgNewExcelGrp.optionValue(0); # dgLanguage.visible(false); # dgServerGrp.visible(false); // does not make sense to access server file while it is in access ... # dgServerGrp.optionValue(0); # dgLabelFileClientAccess.optionValue(1); # dfLabelModuleId.visible(false); # # ret.addGroup().frameType(FormFrameType::None); # dWin = ret.addWindow(); # dWin.imageResource(#ImageInfoLarge); # dWin.leftMode(FormLeft::LeftEdge); # dWin.backStyle(FormBackStyle::Transparent); # ret.addText(strfmt("@SYS32792", new DictType(extendedTypeNum(labelModuleId)).label(), this.excelFileRole())); # ret.addText(strfmt("@SYS32792", new DictType(extendedTypeNum(LanguageId)).label(), this.excelFileRole())); # # return ret; #} ENDSOURCE SOURCE #excelFileRole #protected Caption excelFileRole() #{ # //no super() - parent's method is abstract # return "@SYS11258"; #} ENDSOURCE SOURCE #labelFileRole #protected Caption labelFileRole() #{ # //no super() - parent's method is abstract # return "@SYS72080"; # #} ENDSOURCE SOURCE #new #protected void new() #{ # ; # super(); #} ENDSOURCE SOURCE #run #public void run() #{ # TextBuffer tb = new TextBuffer(); # Com comObject; # ComVariant comVariant; # SysExcelApplication excel = SysExcelApplication::construct(); # SysExcelWorksheet workSheet = this.excelFile(excel); # SysExcelRange range; # # FileName fileName; # LabelId labelId; # # int i; # int lastRow; # str labelExpression; # str labelDescription; # # ; # setprefix(this.caption()); # # super(); # # try # { # range = workSheet.range(this.rangeId(#xls_labelCol, #xls_translationBeginRow)); # labelModuleId = strrem(workSheet.cells().item(range.row(), range.column()).value().bStr(), '0123456789@'); # comObject = range.comObject(); # range.comObject(comObject.SpecialCells(11)); # lastRow = range.row(); # # range = workSheet.range(this.rangeId(#xls_translationExpressionCol, #xls_subTitleRow)); # languageIdTranslation = workSheet.cells().item(range.row(), range.column()).value().bStr(); # # # this.progressInit(this.caption(), lastRow - #xls_translationBeginRow + 1, #AviFileMove); # # for (i = #xls_translationBeginRow; i <= lastRow; i++) # { # range = workSheet.range(this.rangeId(#xls_labelCol, i)); # comVariant = workSheet.cells().item(range.row(), range.column()).value(); # labelId = comVariant.bStr(); # # range = workSheet.range(this.rangeId(#xls_translationExpressionCol, i)); # comVariant = workSheet.cells().item(range.row(), range.column()).value(); # labelExpression = comVariant.bStr(); # # range = workSheet.range(this.rangeId(#xls_translationDescriptionCol, i)); # comVariant = workSheet.cells().item(range.row(), range.column()).value(); # labelDescription = comVariant.bStr(); # # progress.setText(labelId); # # tb.appendText((i != #xls_translationBeginRow ? '\n' : '') + labelId + ' ' + labelExpression); # if (labelDescription) # { # tb.appendText('\n' + labelDescription); # } # progress.incCount(); # progress.update(true); # } # fileName = labelPathName + '\\' + this.buildLabelFileName(labelModuleId, languageIdTranslation); # tb.toFile(labelPathName + '\\' + this.buildLabelFileName(labelModuleId, languageIdTranslation), FileEncoding::UTF8); # info("@SYS92126"); # info(fileName); # } # catch # { # // just fall trough # } # if (excel) # { # excel.workbooks().close(); # } # excel = null; #} ENDSOURCE SOURCE #validate #public boolean validate(Object calledFrom) #{ # boolean ret; # # ret = super(calledFrom); # # if (! excelFileName) # { # ret = checkFailed(strfmt("@SYS26332", WinAPI::fileType(#xls))); # } # # return ret; #} ENDSOURCE SOURCE #construct #public static DEV_LabelFileFromExcel construct() #{ # DEV_LabelFileFromExcel dEV_LabelFileFromExcel = new DEV_LabelFileFromExcel(); # ; # return dEV_LabelFileFromExcel; #} ENDSOURCE SOURCE #main #public static void main(Args _args) #{ # DEV_LabelFileFromExcel dEV_LabelFileFromExcel = DEV_LabelFileFromExcel::construct(); # ; # if (dEV_LabelFileFromExcel.prompt()) # { # dEV_LabelFileFromExcel.run(); # } #} ENDSOURCE ENDMETHODS ENDCLASS ***Element: CLS ; Microsoft Dynamics AX Class: DEV_LabelFileToExcel nicht geladen ; -------------------------------------------------------------------------------- CLSVERSION 1 CLASS #DEV_LabelFileToExcel PROPERTIES Name #DEV_LabelFileToExcel Extends #DEV_LabelFile RunOn #Called from ENDPROPERTIES METHODS Version: 3 SOURCE #actionCaption #protected Caption actionCaption() #{ # //no super() - parent's method is abstract # return "@SYS26056"; #} ENDSOURCE SOURCE #classDeclaration #class DEV_LabelFileToExcel extends Dev_LabelFile #{ #} ENDSOURCE SOURCE #dialog #protected Object dialog(DialogRunbase dialog, boolean forceOnClient) #{ # Object ret; # # ret = super(dialog, forceOnClient); # # dgLabelFileClientAccess.optionValue(labelFileClientAccess ? 1 : 0); # # return ret; #} ENDSOURCE SOURCE #excelFileRole #protected Caption excelFileRole() #{ # //no super() - parent's method is abstract # return "@SYS72080"; #} ENDSOURCE SOURCE #formatWorkSheet #protected void formatWorkSheet(SysExcelWorksheet _workSheet) #{ # SysExcelRange range; # Com rangeCom; # Com fontCom; # Com interior; # ComVariant comVariant = new ComVariant(); # # str fromCol, toCol; # ; # # range = _workSheet.range(this.rangeId('', _workSheet.rows().item(#xls_titleRow).row(), '', _workSheet.rows().item(#xls_subTitleRow).row())); # rangeCom = range.comObject(); # fontCom = rangeCom.font(); # comVariant.boolean(true); # fontCom.bold(comVariant); # # range = _workSheet.range(this.rangeId(#xls_templateExpressionCol, 0, #xls_templateDescriptionCol, 0)); # this.setCellColorLightBlue(range); # # range = _workSheet.range(this.rangeId(#xls_translationExpressionCol, 0, #xls_translationDescriptionCol, 0)); # this.setCellColorYellow(range); # #} ENDSOURCE SOURCE #labelFileRole #protected Caption labelFileRole() #{ # //no super() - parent's method is abstract # return "@SYS11258"; #} ENDSOURCE SOURCE #new #protected void new() #{ # ; # super(); #} ENDSOURCE SOURCE #run #public void run() #{ # TextBuffer labelTemplate = this.labelFile(labelModuleId, languageIdTemplate); # TextBuffer labelTranslation = this.labelFile(labelModuleId, languageIdTranslation); # # SysExcelApplication excel = SysExcelApplication::construct(); # SysExcelWorksheet workSheet = this.excelFile(excel); # SysExcelRange range; # # DEV_LabelLineSplitted splittedLineTemplate; # DEV_LabelLineSplitted splittedLineTranslation = null; # # str oldExpression, newExpression; # str templateLine; # str translatedLine; # str tranlatedExpression; # int curLine = #xls_translationBeginRow; # boolean containsAlreadyData; # boolean labelHasChanged; # # ; # super(); # # try # { # # range = workSheet.range(this.rangeId(#xls_templateExpressionCol, #xls_subTitleRow)); # containsAlreadyData = workSheet.cells().item(range.row(), range.column()).value().bStr() == languageIdTemplate; # # this.progressInit(this.caption(), labelTemplate.numLines(), #AviFileMove); # # this.setCaptions(workSheet); # # if (! containsAlreadyData) # { # this.formatWorkSheet(workSheet); # } # # for (templateLine = labelTemplate.nextToken(true); templateLine; templateLine = labelTemplate.nextToken(true)) # { # progress.setText(templateLine); # splittedLineTemplate = DEV_LabelLineSplitted::constructLine(templateLine, labelModuleId); # if (splittedLineTemplate.decription()) # { # range = workSheet.range(this.rangeId(#xls_templateDescriptionCol, curLine)); # workSheet.cells().item(range.row(), range.column()).value(splittedLineTemplate.decription()); # } # else # { # range = workSheet.range(this.rangeId(#xls_labelCol, curLine)); # workSheet.cells().item(range.row(), range.column()).value(splittedLineTemplate.labelId()); # # range = workSheet.range(this.rangeId(#xls_templateExpressionCol, curLine)); # if (containsAlreadyData) # { # oldExpression = workSheet.cells().item(range.row(), range.column()).value().bStr(); # newExpression = splittedLineTemplate.expression(); # labelHasChanged = strcmp(oldExpression, newExpression); # } # workSheet.cells().item(range.row(), range.column()).value(splittedLineTemplate.expression()); # # # range = workSheet.range(this.rangeId(#xls_translationExpressionCol, curLine)); # if (! splittedLineTranslation) # { # splittedLineTranslation = DEV_LabelLineSplitted::constructLine(labelTranslation.nextToken(true), labelModuleId); # } # else if (splittedLineTranslation.labelNo() > splittedLineTemplate.labelNo()) # { # this.setCellColorOrange(range); # // just wait and do nothing # } # else if (! splittedLineTranslation.decription() && splittedLineTranslation.labelNo() < splittedLineTemplate.labelNo()) # { # do # { # tranlatedExpression = labelTranslation.nextToken(true); # splittedLineTranslation = DEV_LabelLineSplitted::constructLine(tranlatedExpression, labelModuleId); # } # while (splittedLineTranslation.labelNo() < splittedLineTemplate.labelNo() && tranlatedExpression); # } # # if (splittedLineTranslation.labelNo() == splittedLineTemplate.labelNo()) # { # if (! labelHasChanged) # { # tranlatedExpression = splittedLineTranslation.expression(); # } # else # { # tranlatedExpression = ''; # } # if (! tranlatedExpression) # { # this.setCellColorOrange(range); # } # else # { # this.setCellColorClear(range); # } # workSheet.cells().item(range.row(), range.column()).value(tranlatedExpression); # # splittedLineTranslation = DEV_LabelLineSplitted::constructLine(labelTranslation.nextToken(true), labelModuleId); # # } # if (splittedLineTranslation.decription()) # { # range = workSheet.range(this.rangeId(#xls_translationDescriptionCol, curLine)); # workSheet.cells().item(range.row(), range.column()).value(splittedLineTranslation.decription()); # splittedLineTranslation = DEV_LabelLineSplitted::constructLine(labelTranslation.nextToken(true), labelModuleId); # } # /* else # will be collected next time # */ # curLine++; # } # progress.incCount(); # progress.update(true); # } # } # catch # { # // just fall trough; # } # if (excel) # { # excel.visible(true); # } # excel = null; # #} ENDSOURCE SOURCE #setCaptions #protected void setCaptions(SysExcelWorksheet _workSheet) #{ # SysExcelRange range; # ; # range = _workSheet.range(this.rangeId(#xls_templateExpressionCol, #xls_titleRow)); # _workSheet.cells().item(range.row(), range.column()).value(LanguageTable::languageId2Description(languageIdTemplate)); # # range = _workSheet.range(this.rangeId(#xls_translationExpressionCol, #xls_titleRow)); # _workSheet.cells().item(range.row(), range.column()).value(LanguageTable::languageId2Description(languageIdTranslation)); # # range = _workSheet.range(this.rangeId(#xls_labelCol, #xls_subTitleRow)); # _workSheet.cells().item(range.row(), range.column()).value("@SYS58318"); # # range = _workSheet.range(this.rangeId(#xls_templateExpressionCol, #xls_subTitleRow)); # _workSheet.cells().item(range.row(), range.column()).value(languageIdTemplate); # # range = _workSheet.range(this.rangeId(#xls_templateDescriptionCol, #xls_subTitleRow)); # _workSheet.cells().item(range.row(), range.column()).value("@SYS35300"); # # range = _workSheet.range(this.rangeId(#xls_translationExpressionCol, #xls_subTitleRow)); # _workSheet.cells().item(range.row(), range.column()).value(languageIdTranslation); # # range = _workSheet.range(this.rangeId(#xls_translationDescriptionCol, #xls_subTitleRow)); # _workSheet.cells().item(range.row(), range.column()).value("@SYS35300"); # #} ENDSOURCE SOURCE #validate #public boolean validate(Object calledFrom) #{ # boolean ret; # # ret = super(calledFrom); # # if (! languageIdTemplate) # { # ret = checkFailed(strfmt("@SYS26332", "@SYS53423")); # } # # if (! languageIdTranslation) # { # ret = checkFailed(strfmt("@SYS26332", "@SYS40253")); # } # # if (! labelModuleId) # { # ret = checkFailed(strfmt("@SYS26332", new DictType(extendedTypeNum(LabelModuleId)).label())); # } # # # return ret; #} ENDSOURCE SOURCE #construct #public static DEV_LabelFileToExcel construct() #{ # DEV_LabelFileToExcel dEV_LabelFileToExcel = new DEV_LabelFileToExcel(); # ; # return dEV_LabelFileToExcel; #} ENDSOURCE SOURCE #main #public static void main(Args _args) #{ # DEV_LabelFileToExcel dEV_LabelFileToExcel = DEV_LabelFileToExcel::construct(); # ; # if (dEV_LabelFileToExcel.prompt()) # { # dEV_LabelFileToExcel.run(); # } #} ENDSOURCE ENDMETHODS ENDCLASS ***Element: PRN ; Microsoft Dynamics AX Project : DEV_LabelFile unloaded ; -------------------------------------------------------------------------------- PROJECTVERSION 2 PROJECT #DEV_LabelFile PRIVATE PROPERTIES Name #DEV_LabelFile ENDPROPERTIES PROJECTCLASS ProjectNode BEGINNODE FILETYPE 0 UTILTYPE 16 UTILOBJECTID 0 NODETYPE 205 NAME #LabelTools ENDNODE BEGINNODE FILETYPE 0 UTILTYPE 3 UTILOBJECTID 0 NODETYPE 296 NAME #DEV_LabelFileToExcel ENDNODE BEGINNODE FILETYPE 0 UTILTYPE 3 UTILOBJECTID 0 NODETYPE 296 NAME #DEV_LabelFileFromExcel ENDNODE BEGINNODE FILETYPE 0 UTILTYPE 45 UTILOBJECTID 50032 NODETYPE 329 NAME #DEV_LabelLineSplitted ENDNODE BEGINNODE FILETYPE 0 UTILTYPE 45 UTILOBJECTID 50030 NODETYPE 329 NAME #DEV_LabelFile ENDNODE BEGINNODE FILETYPE 0 UTILTYPE 45 UTILOBJECTID 50031 NODETYPE 329 NAME #DEV_LabelFileFromExcel ENDNODE BEGINNODE FILETYPE 0 UTILTYPE 45 UTILOBJECTID 50029 NODETYPE 329 NAME #DEV_LabelFileToExcel ENDNODE ENDPROJECT ***Element: END