ELM-Python-Client icon indicating copy to clipboard operation
ELM-Python-Client copied to clipboard

--view parameter of represt not working (not filtering the attributes that should not be in the view)

Open denisbelanger101 opened this issue 10 months ago • 5 comments

Hi, I am using represt to export a DNG Module to Excel. The only remaining issue is this one. Here is what I found using the debug tool in elmclient. The DNG View URI is found using the text name of the view which is a good start. My command line is the following: represt rm resources -J "https:server" -U myusername-P mypassword! -p "myprojectname" -m "mymodulename" --view "Test1" -C "myCSVfilename"

So, the DNG View name is "Test1". In DNG, in the Module, you can see View "Test1". On the right side of the below screenshot, you can see the attributes selected to be visible in this View. image

But in the Excel output file you can find all attributes of this Module, even the one that are not selected for this View. Since we are in a view that does not include these attribute, they should be filtered out and not appear in the Excel output file. Here is one of them as an example the below one... image

And indeed, if I add this attribute to the view, it looks like this in DNG: image

Is there someone who could look at this, I would appreciate it so much!

Thank you!

denisbelanger101 avatar Mar 10 '25 13:03 denisbelanger101

AFAICT what you're observing is how the DNG Reportable REST API works. The view filters the rows but doesn't observe the columns. This behaviour isn't mentioned in the documentation, but there is a section "Common information for the response" which implies that the listed attributes/info is common to all responses, i.e. not affected by asking for a view.

So the --view option is working correctly :-)

barny avatar Mar 11 '25 08:03 barny

Ok, just to summarize. A view in DNG does two things:

  1. it filters the row to show as shown below:
Image
  1. it records the columns to show for this view and hides the other columns (attributes), as shown below.
Image

So what you are saying is, that the DNG Reportable REST API does only the first item #1 above but not #2. Is this is correct, is there a way to grab the columns to show that are recorded by a view? Or if it will always show ALL columns of a Module?

denisbelanger101 avatar Mar 11 '25 13:03 denisbelanger101

the DNG Reportable REST API does only the first item https://github.com/IBM/ELM-Python-Client/discussions/1 above but not https://github.com/IBM/ELM-Python-Client/pull/2.

Yes that's correct.

it will always show ALL columns of a Module?

Basically yes.

a way to grab the columns to show that are recorded by a view

In terms of APIs, I don't think so

In Report Builder you could (perhaps) reproduce the view and that can export to spreadsheet formats. Or similar with an RPE report.

barny avatar Mar 12 '25 11:03 barny

Great. Thanks. And a last thing, if the columns names are the same in from one file to the other, to export, is there a parameter I can use with represt to specify the column names that I want the code to export?

denisbelanger101 avatar Mar 12 '25 19:03 denisbelanger101

is there a parameter I can use with represt to specify the column names

No - although I'm sure it's possible. FYI I don't have any plan to do this.

barny avatar Mar 14 '25 10:03 barny

closing due to inactivity

barny avatar Aug 01 '25 12:08 barny