Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
ColumnMeta
is used to set meta data for one or more than one columns:
->pipe(new ColumnMeta(array(
"my_column_name"=>array(
"label"=>"My Column Name",
)
)))
Remember name of column is different from label of column. Label is a nice name which is normally used to display.
The column name is the result of the query. How could I label the column name? I want to label as datefrom and dateto.
The column name contain numbers, which is date. If I do as above, this will result in an error. However, other columns which contains only alphabets were able to work.
Thanks.
You may try to do this:
->pipe(new ColumnMeta(array(
'date("2017-07-01")'=>array(
"name"=>"date_form", //Rename the column name
)
)))
Note: Use the single quote
Why do you need to name the column in a "hard" way like this? May I view your SQL statement or source of data?
Thanks. I managed to do it. I could not change the SQL statement. Otherwise, there will be no such problem. I need your favor again. Thanks in advance.
How could I display Table B from Table A?
I was able to merge columns POINT and PERCENT using CalculatedColumn. However, when I rearrange the columns and sum it at the footer, it will result in an error and only display sum for POINT, not sum for both POINT and PERCENT. Can you show me how this could be done?
Thanks.
As I see in the table B, seems you merge the header of Point and Percent into M Point. The Table widget does not support it. You only can show below result with Table widgets.
Name | Point | Percent |
---|---|---|
x | 10 | 50.0% |
y | 10 | 50.0% |
Total | 20 | 100.0% |
Below code to generate table like above:
Table::create(array(
...
"showFooter"=>"bottom",
"columns"=>array(
"name",
"point"=>array(
"footer"=>"sum",
),
"percent"=>array(
"footer"=>"sum"
"type"=>"number",
"suffix"=>"%"
),
)
));
Oh I see. Thanks.
Referring to your guidance above, I realized that "2017-07-01" is from the user's input. The date changes according to user's input.
->pipe(new ColumnMeta(array(
'date("2017-07-01")'=>array(
"name"=>"date_form", //Rename the column name
)
)))
How could the above be done based on the user's input, as the column name changes according to the user's input? Example: When the user selects 2017-07-01, the column name will be date("2017-07-01"). And when the user selects 2017-07-19, the column name will be date("2017-07-19").
Thanks.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo