1
Guys, I have a problem and I couldn’t think of a solution ... People who have used iReport know that it has to do grouping very easily in it... The problem is that I am now reporting in HTML ( in the nail rs ), and wanted to group by affiliates ( as example ):
Filial 001 - LOJA TAL
column column column column column
dados dados dados dados dados
dados dados dados dados dados
dados dados dados dados dados
Total da Filial 001 = TOTAL TOTAL TOTAL TOTAL TOTAL
Filial 002 - LOJA TAL
column column column column column
dados dados dados dados dados
dados dados dados dados dados
dados dados dados dados dados
Total da Filial 002 = TOTAL TOTAL TOTAL TOTAL TOTAL
Total Geral = TOTAL GERAL
And so on.. in iReport just put a group... But now that I’m doing it in HTML, I can’t find a solution to my problem... Because it’s repeating the name of the branch on all the lines, and I couldn’t think of how to make the total for branch and then the total General...
Example :
Let’s say the numbers come (query result) (1, 1 , 1, 1, 1, 2, 2, 2, 3, 3, 3,) Printar only : 1, 2 , 3.
I have tried to take the values of the branch table and compare with the result of branches that is coming from the query, but it did not work, keeps printing repeatedly.
For example :
$filias => $this->find(filiais)
$dadosConsulta['numero_filial'] (este aqui que está vindo repetido, filial para cada resultado)
if($filiais['numero_filial'] == $dadosConsulta['numero_filial']){
echo $dadosConsulta['numero_filial'];
}
I tried something like this above, but it didn’t work either... repeated printava yet. I would like your help ! Thanks.
Edit:
Following image.. At the end when switching from branch 1 to 2 and 2 to 3, so successively, printar Total by Branch, it boils down to this ! Because the way I’m doing it, it’s being printed after every result per seller. Several times.
Thanks for the answer, so... I’m already making a loop inside the loop, the problem is that the data is coming like this, example : ( Store 1, Store 1, Store 1, Store 2, Store 2, Store 2, Store 3 , Store 3 , Store 3 and so on ), so if I compare branch to branch, it will repeat branch offices in the same way.
– Edson Rodrigues
Would be 3 levels? Level 1: Shop, Level 2: Affiliate, Level 3: Products? Would be 3 loops?
– Allan Andrade
Yes, I believe with 3 loops it would work (I updated my answer).
– Allan Andrade
Let me know if it works out okay?
– Allan Andrade
Allan Andrade, I have a query that brings all the data I need, and in front of where is this data ( that branch ), so it comes all in one query ! I’ll try to add images
– Edson Rodrigues
Take a look at the idea I posted in the answer above.
– Allan Andrade
But the 3 loops because ? Being that everything is within 1 array, that is the result of the query. Store and Branch is the same thing, ie, would be 2 loops.
– Edson Rodrigues
Let’s go continue this discussion in chat.
– Allan Andrade
Okay! I texted you there.
– Edson Rodrigues
Allan Andrade, thanks for your help so far! So, until the part of only show the name of the branch only once worked out... now is missing only the result BY AFFILIATE... This comes from another search, or if you have another way to show this result by affiliate, beauty too...
– Edson Rodrigues
The result per branch is being printed only from the second branch onwards... and the value of the first branch is being printed in the second branch, and the second branch in the third and so on. I’ve been trying to figure it out, but it didn’t work out.
– Edson Rodrigues