It would be nice to be able to print the parameter into the report.

Comments

metzlerd’s picture

Component: Report » Documentation

You can. Sorry I haven't documented it better. Prefix it with parm.

{parm.myparm}
janeks’s picture

Version: 6.x-1.0-beta1 » 7.x-2.x-dev

What about multivalue parameter output in a report:
All that I got was:
Array
But I would need someting like:
aVal1 aVal2

metzlerd’s picture

Yes you are correct, that would be nice. I'll get to working on this when I can.

metzlerd’s picture

Version: 7.x-2.x-dev » 7.x-3.0-beta3
Assigned: Unassigned » metzlerd
Status: Active » Fixed

Array parameters display space separated in the report.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

janeks’s picture

Status: Closed (fixed) » Active

There are two cases when we would need insert parameters in the report:
One is for selected parameters value output in the report. F.ex. it is good for PDF reports - so that user would know what a report is about from the view of selected parameters.
The second is for embedded elements like SVG charts, GeoMaps etc.

When there are single value parameters it is o'k, but not so when there is multivalue parameters.
Now the simple version with parameters as spaces separated list - works for first case, but for second - needs at least some JS hacking. I recently started tinkering around graphs in Forena and found that in multivalue cases we need the form:
aparam[avalue]=avalue&aparam[bvalue]=bvalue.
BTW: q. - do wee need these [avalue] as duplicates if we have the same after "="?

But for feature requested - could it be so that we have two ways of parameter templates:
{parm.myparm.list} that outputs space separated list (also default for {parm.myparm})
and
{parm.myparm.url} that outputs URL like string.

brgds
Janeks

metzlerd’s picture

First, the correct syntax for multivalue parameters is

aparm[]=firstvalue&aparm[]=value2

This is the way that url parameters are supposed to be expressed. If you just need the values for javascript would it be better to to pass them in as a json object in the drupal settings array? That way you could reference the raw values as needed?

The latest version of forena already treats parameters differently based on how they are being used. This may complicate issues.

If you could give a brief example of the context thst you need these in it would help us understand whether they can be accomplished via existing functionality.

janeks’s picture

F.ex. in case of embeded charts . I want that chart will use the same parameters like parent report an that can be multi value parameters.

Regarding right parameter URL syntax - my previous example was taken from addres bar of browser after submiting a report paramter form with multivalue parameters.

metzlerd’s picture

Got it. Let me check out the FrxInclude renderer, I think the best approach would be to find a simple way to pass all the parameters through at once. I did something link this for links, so I might try that approach instead. Would that work?

Probably the syntax you are getting is using is coming from the drupal Checkboxes control. If it were a select it would come out differently. I'll look into cleaning that up as well.

Dave

metzlerd’s picture

Version: 7.x-3.0-beta3 » 7.x-3.x-dev
Status: Active » Fixed

This has been fixed. You can now include multivalue parameter references in the source (and in links). So if you reference this in the FrxInclude source or in links as

reports/myreport?myparm={parm.somemultivalueparm}

And the parameter is an array, it will be included as an array in the link that is generated.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.