php-reports icon indicating copy to clipboard operation
php-reports copied to clipboard

Pass parameter to drill-down

Open brokentwig opened this issue 9 years ago • 1 comments

How do a pass a parameter to a drill down? The below words for a column, but I don't see anything in the documentation to pass a variable that's set in the parent report.

-- FILTER: {
--      column: "Keyword",
--      filter: "drilldown",
--      params: {
--          macros: { "keyword": { column: "Keyword" } },
--          report: "income_detail.sql"
--      }
-- }

brokentwig avatar Dec 05 '16 03:12 brokentwig

Depends on what you mean by "variable"

If you mean that the parent report has a -- VARIABLE header and you want that name/value pair passed to the drilldown report, then you don't need to specify that. php-reports passes all report parameters (-- VARIABLE macros) down to drilldown reports automatically.

If you mean that you have a SQL variable in your query, like set @timezone="-0700"; then the only way to do it is to put a column into the parent report having that value. It will look funny in the parent report, since there will be a column that has the same value in every row. But you can hide that column in the parent report using the "hide" FILTER. -- FILTER: { filter: "hide"; column: "Timezone" } Or if you mean something else, please elaborate.

edu-bob avatar May 23 '17 23:05 edu-bob