mysticfall / pivot4j

Pivot4J provides a common API for OLAP servers which can be used to build an analytical service frontend with pivot style GUI.
Other
128 stars 101 forks source link

Integrate with CDE parameters #184

Closed pengisgood closed 9 years ago

pengisgood commented 9 years ago

After I install the pivot4j plugin from the marketplace, I can build up a table which can expand/collapse, then save it as 'demo.cdfde.pivot4j'.

In the CDE, I add a Pivot4J Widget Component and set the file path property to 'demo.cdfde.pivot4j'.

Questions

  1. Is there a way to pass parameters from filters on dashboard to the query used by the table instead of hard code in the file?
  2. When I export as xls or xlsx files, is it able to put the expanded items into different columns? I would imagine that on the export there would be a column each for Province, District, Health Facility, if it is expanded down to that level. For example, in the screenshot below, instead of export the first column into one column with different intent, just export them into three columns.

qq20150609-1 2x

mysticfall commented 9 years ago

By default, the Analytics client expose all initial request parameters given to the open.xhtml to the EL context, which you can refer in your MDX as parameters.[variable name].

Due to its escaping rules, the EL syntax might look rather confusing, especially used in MDX. So you might want to check the sample here: https://github.com/mysticfall/pivot4j/issues/117

As to the latter question, the current implementation follows the same between rendering and exporting. So, if you enable the show parents option, it will export the data as it's shown in the browser in the way you described.

It's possible to make the export function to behave that way even when the show parent option is disabled, but it will require some source level modifications.

pengisgood commented 9 years ago

Thanks for your reply. I won't be able to get enough time to do source level modifications, so I just enable both the show parent option and the show span option to fulfill our export requirements.

Another question is: when I'm trying to embed the pivot4j table into a dashboard, how many kinds of parameters I can use to set the default behavior of the pivot4j widget, like embeded, editable, etc.? And is there a detailed documentation for that?

I set this kind of url to the src property of iframe: /pentaho/plugin/pivot4j/faces/open.xhtml?embeded=false&path=%2Fpublic%2FReport-ComprehensiveReport%2FReport-ComprehensiveReport.cdfde.pivot4j

mysticfall commented 9 years ago

There's no documentation for request parameters, but those you mentioned are all the available names for the reserved parameters (see open.xhtml).

All other parameters are passed as it is to the EL context, which can be referenced in expressions used in the properties or MDX statement.

Please let me know if you have any other questions regarding those parameters.

pengisgood commented 9 years ago

one thing I just want to confirm is: does the value of editable property is based on the file properties in pentaho repository?

In Pentaho, I found if I change the share property of *.pivot4j file, grant read and write permission, then embed it into dashboard, visit it with non-admin user, the edit button is there otherwise not.

mysticfall commented 9 years ago

My memory is a bit fuzzy about it, but I believe you're right. It's determined by whether the ReportContentGenerator or ReportContentEditor is used to open a report, and if I'm not mistaken it's automatically chosen by the platform, depending on the fact that the report is editable or not.

pengisgood commented 9 years ago

OK, Thanks for your quick reply which is really helpful to understand pivot4j better.

Nothing more and I should close this issue now. Thanks again.