Issue when running the custom report

Hello experts, I hope everyone is doing great.

We’ve experienced an issue while working on reports. We’re passing hardcoded values into the report form; these values aren’t being passed into the report if I run the report template directly from the “Reports Tab.” They’re being passed only if I create an instance of it or run an already-created instance from the “My Reports” tab. Is there any way to execute the report directly with hardcoded values in it?

Hi @LohithHarish,

in Reports tab you find the templates, yours or default of SP. Every time you want launch it, you must create a report and it will be created in My Report tab. According with permision, this report is only yours or avaible for all users.

Later, you can use this report for schedule or execution, with the configuration made at the time of creation, but you can change it in second time. Also, if you change the template, you will change all the report correlated with the template.

The simplest way for change a column is the RenderScript, where you can change the result value of the column.
Example:

<ReportColumnConfig field="identity" header="Name;" property="l" sortable="true" width="80">
                <RenderScript>
                  <Source>
                    import sailpoint.object.Link;
                    try{          
                      Link l = value;
                      l.getIdentity().getName();
                      if (l.getApplication().getName().equals("ACTIVE DIRECTORY")){
                          Integer obj =  Integer.parseInt(l.getIdentity().getAttribute("StatusAD"));
                            if ((obj / 2) % 2 == 0)
                            {
                              return "Active";
                            }
                            else
                            {
                              return "Inactive";
                            }
                          }
                      }
                      return l.getIdentity().getName();
                    }
                    catch(Exception e){                  
                      return null;
                    }
                   </Source>
                </RenderScript>
              </ReportColumnConfig>

whit this you can add code, reading a custom or put a fixed value a return it.

You can see this topic too, maybe can help you:

1 Like

You can trigger report from the rule by passing inputs like below. I have tested and it is working.

        String taskName = " Access Details Report" ;
        TaskDefinition runReport=context.getObject(TaskDefinition.class, taskName );
        if (runReport== null){
        	throw new Exception("Report not found");
        }

        var inputsMap = new HashMap();
        inputsMap.put("key1", value1);
        inputsMap.put("key2", value2);
        
        var tm = new sailpoint.api.TaskManager(context);
        
        var taskResult = tm.runWithResult(runReport, inputsMap);
        String newTaskName = taskResult.getName();
        taskResult.setName(newTaskName);
        context.saveObject(taskResult);
2 Likes

Thanks for the reply, @enistri_devo and @vedeepak.

The actual issue is that we’ve created a custom report and a custom report form. Assume there is a field named “X” inside the Report form, and three values 1, 2, and 3 are hardcoded over there. When the user creates and runs a report using the template, the values are being passed seamlessly, and a report is getting created in the My Reports tab as well. The report in the My Reports tab is working as well. But the issue is that when the user runs the Custom Report (Report Template) directly from the Report tab, hardcoded values aren’t being passed. So is running the created instance from the My Reports tab the only way for the values to be populated?

I think you refer if user launch the report like this:
image

in this case, the report will be launched without filter:

Better if you give the permission to user for seeing the report(in “My report”) or the user create the report directly and launch it.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.