KoolReport's Forum

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

Table: Grouping repeated cells #178

Open bysystem opened this topic on on Dec 21, 2017 - 9 comments

bysystem commented on Dec 21, 2017

Dear support team,

how can I group the repeated cell items in a table (see TABLE1) as a result like in TABLE 2 (hide the repeated cell contents): (I know this is possible in PIVOT package, but I don't want to use this as I can't remove the subtotals)

Kind regards,

KoolReport commented on Dec 23, 2017

It is possible. Please put

Table::create(array(
    ...
    "removeDuplicate"=>array("customerNo","customerName"),
    ...
))
bysystem commented on Dec 27, 2017

Thx for your hint! I put the removeDuplicate property into my code as follows but however it does not work:

						Table::create(array(
						  "dataStore"=>$this->dataStore('Reporting.autorep_v_0_Bestaende_Table'),
						  "showFooter"=>"bottom",
						  "columns"=>array(
							"WerbegruppeVerbund"=>array(
								"label"=>"Werbegruppe",
								//"formatValue"=>function($value)
								//{
								//	return ""; //Leere Spalte in der Tabelle
								//},
								//"footerText"=>"<span style='font-size:150%;'><b>".$Werbegruppe_Verbund."</b></span>",									
							),
							"NikonKdName"=>array(
								"label"=>"Kundenname",
							),
							"NikonOrt"=>array(
								"label"=>"Kundenort",
							),
							"NikonArtBez"=>array(
								"label"=>"Artikel",
							),	
							"BestandHaendler_aktuell"=>array(
								"label"=>"Bestand Händler",
								//"footer"=>"sum",
								//"footerText"=>"<span style='font-size:150%;'><b>@value</b></span>",									
								"cssStyle"=>"text-align:right;font-weight:bold;font-size:100%;",
							),
							"BestandZentrale_aktuell"=>array(
								"label"=>"Bestand Zentrale",
								//"footer"=>"sum",
								//"footerText"=>"<span style='font-size:150%;'><b>@value</b></span>",																		
								"cssStyle"=>"text-align:right;font-weight:bold;font-size:100%;",
							),
						  "removeDuplicate"=>array("WerbegruppeVerbund"),	
						)));

Here is still the output with 2 x "Einzelhaus", 3 x "Expert Bening", 2 x "Expert Heinze & Bolek" (in the column Werbegruppe):

Any idea how to fix this?

KoolReport commented on Dec 27, 2017

Hi, the removeDuplicate must be outside of "columns":

    ...
    "columns"=>array(
        ...
    ),
    "removeDuplicate"=>array("WerbegruppeVerbund")
bysystem commented on Dec 27, 2017

I put it now it directly after the "colums" but the result is excat the same like above:

							Table::create(array(
							  "dataStore"=>$this->dataStore('Reporting.autorep_v_0_Bestaende_Table'),
							  "showFooter"=>"bottom",
							  "columns"=>array(
								"WerbegruppeVerbund"=>array(
									"label"=>"Werbegruppe",
									//"formatValue"=>function($value)
									//{
									//	return ""; //Leere Spalte in der Tabelle
									//},
									//"footerText"=>"<span style='font-size:150%;'><b>".$Werbegruppe_Verbund."</b></span>",									
								),
								"NikonKdName"=>array(
									"label"=>"Kundenname",
								),
								"NikonOrt"=>array(
									"label"=>"Kundenort",
								),
								"NikonArtBez"=>array(
									"label"=>"Artikel",
								),	
								"BestandHaendler_aktuell"=>array(
									"label"=>"Bestand Händler",
									//"footer"=>"sum",
									//"footerText"=>"<span style='font-size:150%;'><b>@value</b></span>",									
									"cssStyle"=>"text-align:right;font-weight:bold;font-size:100%;",
								),
								"BestandZentrale_aktuell"=>array(
									"label"=>"Bestand Zentrale",
									//"footer"=>"sum",
									//"footerText"=>"<span style='font-size:150%;'><b>@value</b></span>",																		
									"cssStyle"=>"text-align:right;font-weight:bold;font-size:100%;",
								),
							  	
							),
							"removeDuplicate"=>array("WerbegruppeVerbund"),
							));

bysystem commented on Dec 27, 2017

An additional info for you:

I've just updated my KoolReport version to 3.0.0. and the result is unfortunately the same!

Kind regards,

KoolReport commented on Dec 28, 2017

That's strange. I've tested the "removeDuplicate" with latest KoolReport 2.0.0 and it seems working very well.

bysystem commented on Dec 28, 2017

Hmmm... What could be wrong in my code above?

Do you need any further information?

bysystem commented on Dec 28, 2017

It works fine now! There was a missing "//" for a comment line!

KoolReport commented on Dec 28, 2017

That's great!

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
solved

None