KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

How to Implement the complex header in cube #2197

Open Komuraiah A opened this topic on on Jul 10, 2021 - 9 comments

Komuraiah A commented on Jul 10, 2021

Dear Team,I am implemented the code of cube .Now i want to implement the complex header in cube.so could you please help me with example code.

Sebastian Morales commented on Jul 12, 2021

Did you mean DataTables' complex header property like in this example?

https://www.koolreport.com/examples/reports/datagrid/complex_headers/

You could simple set DataTables' "headerSeparator" property for Cube's columns or use ColumnRename or Map process to change Cube's column names to the structure you like. If you want a more specific guide pls post a specific example data. Tks,

Komuraiah A commented on Jul 12, 2021

Dear Team,I am implemented the code of cube years-months concept .And implemented the header in cube.but it not working.

"complexHeaders" => true,
        "headerSeparator" => "-",

So please help me how to implement the complex headers in years-months cube concept with example code.

Sebastian Morales commented on Jul 13, 2021

I don't think the Cube's columns use "-" as separator. Pls print out a row of your Cube's result to see the column names and decide which separator should be used. Tks,

Komuraiah A commented on Jul 13, 2021

Dear Team, according to our requirement I have implemented the cubes concept years-months. now I want to implement the complex header concept in cube. below is the image what I want the exact output .so please help me the example with code.

Sebastian Morales commented on Jul 14, 2021

Pls show us the column names of your Cube's datastore. Rgds,

Komuraiah A commented on Jul 15, 2021

Dear Team,I am implemented the cubs.now I want to implement the header concept in cubes and below are the column names .

column names: monthname,year,column1 as a, column2 as b,column3 as c,column4 as d

The above column names are selecting from table with query and i want to display the output like below format.

https://cdn.koolreport.com/assets/images/editor/c5/image60ed20238d1bb.jpg

Sebastian Morales commented on Jul 15, 2021

I meant the column names after the Cube process, not the original ones. One simple way to get them is to print out your final datastore's data. There you could see the data rows with their column names. Rgds,

Komuraiah A commented on Jul 15, 2021

Dear Team,below are the column names that are displayed after the cube process

$node->pipe(new Cube(array(
		"row" => "monthname",
            "column" => "year",
			"sum" => "a",
            "count" => "b",
			 "count" => "c",
			  "count" => "d"
        )))
Sebastian Morales commented on Jul 16, 2021

Hmm, I think in this case you had better use the Pivot process in report setup and PivotTable/PivotMatrix (with their "showDataHeaders" => true) in report view. It would create an exact view like what you described. Tks,

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Cube