Hi !
I have a report GUID but I don't know the name of the report. I need to find this report in order to make changes in the script, so to find the report I would like to write a script that goes through all the reports that I have on ARIS and print their names and their associated GUID.
Does someone know how can I go through all the reports on ARIS and extract their GUIDs ?
Hello,
We provide a solution (check partner hub - report manager) that allow to create an ARIS database with the list of all your report, the source code, the GUID, and the linked library files.
This was created to solve the issue your are mentionning but also to have an ARIS database with all sources of report and versionning possibilities.
Do not hesitate to contact us if you want to know more.
Kind regards
Tanguy
Hi,
while the already mentioned solution would certainly help you, I think I've got something that does exactly what you want it to do.
Report-Context: doesn't matter
Output-Format: .xls
var nLocale = Context.getSelectedLanguage();
var oOutput = Context.createExcelWorkbook(Context.getSelectedFile());
var scriptadmincomponent = Context.getComponent("ScriptAdmin");
var scriptComponentInfo = scriptadmincomponent.getScriptComponents();
var reportScriptComponentID = null;
for each(var singleScriptComponentInfo in scriptComponentInfo){
if(singleScriptComponentInfo.getComponentName() == "Report"){
reportScriptComponentID = singleScriptComponentInfo.getComponentID();
}
}
if(reportScriptComponentID != null){
var reportCategories = scriptadmincomponent.getCategories(reportScriptComponentID, nLocale);
for each(var reportCategory in reportCategories){
var scriptInfos = scriptadmincomponent.getScriptInfos(reportScriptComponentID, reportCategory.getCategoryID(), nLocale).filter(scriptInfoFilter).sort(sortScriptInfo);
var sheet = oOutput.createSheet(reportCategory.getName());
sheet.cell(0, 0).setCellValue(reportCategory.getName());
var headerRow = sheet.createRow(2);
var columnReportName = 0;
headerRow.createCell(columnReportName).setCellValue("Report name");
var columnAvailableUsers = columnReportName + 1;
headerRow.createCell(columnAvailableUsers).setCellValue("Available for client users");
var columnAvailableConnect = columnAvailableUsers + 1;
headerRow.createCell(columnAvailableConnect).setCellValue("Available for connect users");
var columnDesc = columnAvailableConnect + 1;
headerRow.createCell(columnDesc).setCellValue("Description");
var columnID = columnDesc + 1;
headerRow.createCell(columnID).setCellValue("GUID")
var dataRowIndex = 3;
for each(var scriptInfo in scriptInfos){
var dataRow = sheet.createRow(dataRowIndex);
dataRow.createCell(columnReportName).setCellValue(scriptInfo.getName());
dataRow.createCell(columnAvailableUsers).setCellValue(booleanToWord(scriptInfo.isAvailableForUsers()));
dataRow.createCell(columnAvailableConnect).setCellValue(booleanToWord(scriptInfo.isAllowedInConnect()));
dataRow.createCell(columnDesc).setCellValue(scriptInfo.getDescription());
dataRow.createCell(columnID).setCellValue(scriptInfo.getID());
dataRowIndex++;
}
}
}
oOutput.write();
function scriptInfoFilter(x){
return !(x.isSimpleFile());
}
function sortScriptInfo(x, y){
if(x.getName() > y.getName()){
return 1;
} else if (x.getName() < y.getName()){
return -1;
} else {
return 0;
}
}
function booleanToWord(someBoolean) {
if(someBoolean) {
return "Yes"
} else {
return "No";
}
}
This does exactly what you said you wanted to do - go through the existing reports and print their name alongside their GUID. The report puts the information of one report category into one excel sheet and creates however many sheets it needs to cover all your report categories.
The current implementation also outputs the report description, as well as information about the report availability in the client and in connect. You can just ignore that information (that's what I originally wrote this report for - adjusting it to also output the GUID was easy).