/*#include //#include #include #include // Required for GE Logo #include #include */ const int nTestStatus = 0 const int nOriginalColumns = 0 string strBlank = "" Column gColumnToModify = null string strColorAttr = "null" bool bColumnFound = false Module mMod = current AttrDef ad int nColumnToDeleteAndAddBack int nMainWidth int nOriginalWidth[20] const string strOriginalColumnTitle[] = {"","","","","","","","","","","","","","","","","","","",""} // 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 const string strOriginalColor[] = {"","","","","","","","","","","","","","","","","","","",""} // 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 int nMainColumn const int MAX_COLUMNS = 4 const string strColumnTitle[] = {"Base ID","VV_Test_Idenfifier","","Test Comment"} // 0,1,2,3 string strProcEditText void OriginalColumns() { int nCount = 0 int nLoop Column col for ad in mMod do { if ((ad.object) && (!ad.system)) { nMainColumn = 0 col = column (nCount) if (main(col)) { nMainColumn = nCount nMainWidth = width(col) } // end if (main(col)) nOriginalWidth[nCount] = width(col) // Save the pixel width of each column strOriginalColumnTitle[nCount] = title(col) // Save the title of each column strOriginalColor[nCount] = color(col) // Save the color of each column nCount++ } // end if ((ad.object) && (!ad.system)) } // end for ad in mMod do for (nLoop = 0; nLoop < nCount; nLoop++) { if (strOriginalColumnTitle[nLoop] != strBlank) { nOriginalColumns = nLoop +1 } // end if (strOriginalColumnTitle != strBlank) } // end for (int nLoop = 0; nLoop < nCount; nLoop++) } // OriginalColumns() void DeleteColumns() { int n = 0 // number of existing columns int i // column index Column c for c in current Module do n++ // count the columns // delete n column 0s for i in 1:n do { delete column 0 } // end for i in 1:n do } //DeleteColumns() void SpreadsheetColumns() { int nLoop int nWidth int nNewMainColumn = 2 for (nLoop = 0; nLoop < MAX_COLUMNS; nLoop++) { nWidth = 100 Column col string strTitle = strColumnTitle[nLoop] string strColor = null //strOriginalColor[nLoop] col = insert (column nLoop) if (nLoop == nNewMainColumn) { main(col) nWidth = nMainWidth } // end if (nLoop == nMainColumn) else attribute(col, strTitle) // Copy the column color, if it exists if( !null strColor ) { color( col, strColor) } // end if( !null strColorAttr ) width(col, nWidth) } // end for (nLoop = 0; nLoop < nOriginalColumns; nLoop++) } //SpreadsheetColumns() void ReplaceOriginalColumns() { int nLoop int nWidth for (nLoop = 0; nLoop < nOriginalColumns; nLoop++) { nWidth = nOriginalWidth[nLoop] Column col string strTitle = strOriginalColumnTitle[nLoop] string strColor = strOriginalColor[nLoop] col = insert (column nLoop) if (nLoop == nMainColumn) { main(col) } else attribute(col, strTitle) // Copy the column color, if it exists if( !null strColor ) { color( col, strColor) } // end if( !null strColorAttr ) width(col, nWidth) } // end for (nLoop = 0; nLoop < nOriginalColumns; nLoop++) } //ReplaceOriginalColumns() int ColumnCheck(string strColumn) { int nCount = 0 Column col for ad in mMod do { if ((ad.object) && (!ad.system)) { col = column (nCount) strTitle = title(col) if (strTitle == strColumn) { bColumnFound = true gColumnToModify = col strColorAttr = color(gColumnToModify) break } // end if (strTitle == strColumn) nCount++ } // end if ((ad.object) && (!ad.system)) } // end for ad in mMod do nTestStatus = nCount return(nTestStatus) } // ColumnCheck() void AddColumn(int nColumnIdentifier) { bool bColumnID = false string attrName int nCount = nColumnIdentifier Column col for ad in mMod do { if ((ad.object) && (!ad.system)) { col = column (nCount) strTitle = title(col) if (strTitle == strColumnTitle[nColumnIdentifier]) bColumnID = true nCount++ } // end if ((ad.object) && (!ad.system)) } // end for ad in mMod do nCount = nColumnIdentifier for ad in mMod do { if (bColumnID == false) { if ((ad.object) && (!ad.system)) { attrName = ad.name if((attrName == "RTF NonShpPict") || (attrName == "RTF ShpPict")) { attrName = null } // end if((attrName == "RTF NonShpPict") || (attrName == "RTF ShpPict")) else { col = insert (column nCount) attribute(col, strColumnTitle[nColumnIdentifier]) width(col, 100) bColumnID = true break } // end else } // end if ((ad.object) && (!ad.system)) } // end if (bColumnID == false) } // end for ad in mMod do } // AddColumn() string strDialogTitle = "Export Procedure Edits to Excel " DB ProcEditBox = create(strDialogTitle) DBE dbeLabel = label(ProcEditBox, "User shall be able to run a script which will filter procedure edits in a DVP and export into an Excel spreadsheet.") void Insert(DB ProcEditBox) { pragma runLim, 0 //disables the "Execution Timeout" dialog // mMod = current - This causes -R-E- DXL: null Attribute Def do loop parameter was passed current = mMod // This script will filter any procedure edit steps, then export to Excel int nLoop, nMaxLoop = MAX_COLUMNS // remove the Test Status column nColumnToDeleteAndAddBack = ColumnCheck("Test Status") if (bColumnFound) delete(gColumnToModify) for (nLoop = 0; nLoop < nMaxLoop; nLoop++) { AddColumn(nLoop) // Add a predetermined column if not present } // end for (nLoop = 0; nLoop < nMaxLoop; nLoop++) Filter f1 = column("Test Comment",strProcEditText) set(f1) filtering on makeExcelExportUI(mMod) //write the file to excel here - proprietary function - based on Galactic Solutions Group, LLC filtering off ReplaceOriginalColumns // put back the Test Status column if (bColumnFound) { gColumnToModify = insert (column nColumnToDeleteAndAddBack) attribute(gColumnToModify, "Test Status") // Copy the column color, if it exists if( !null strColorAttr ) { color( gColumnToModify, strColorAttr ) } // end if( !null strColorAttr ) width(gColumnToModify, 100) } // end if (bColumnFound) if (showing ProcEditBox) { hide(ProcEditBox) destroy(ProcEditBox) // free up resources now ProcEditBox = null } // end if (showing ProcEditBox) } // Insert() apply(ProcEditBox, "Export", Insert) show ProcEditBox // No text can appear after here as it will not be executed!!!!!!!!! s it