Page 1 of 1

Remove

Posted: Wed Jul 25, 2018 5:13 pm
by IskandarAir
Dear Stimulsoft team,

We are facing an issue - we cant hide group header band when the group have no PROPER value (our custom logic when records have no salary data).
Our custom logic use the following code to hide rows with employees that didn't get payment yet, but records' row exists & comes from db.

Code: Select all

 
            dataBand.Conditions.Add(new StiCondition
            {
                Item = StiFilterItem.Expression,
                Expression = cond, //comment -  smth like - (Data.CP4 == 0 || Data.CP4 == -9999999) && (Data.CP5 == 0 || Data.CP5 == -9999999)
                Enabled = false
            });
We can hide footer by using variable (simple idea when group-header starts we start counting by adding 1 to variable and if at the end of group header variable is 0 - then hide). The code is following:

Code: Select all

            var departmentGroupFooterBand = report.GetComponentByName("DepartmentGroupFooterBand") as StiContainer;
            //removing footer with empty data rows which has empty additional column
            if (departmentGroupFooterBand != null)
            {
                departmentGroupFooterBand.Conditions.Add(new StiCondition
                {
                    Item = StiFilterItem.Expression,
                    Expression = $"{valueRowsVar} == 0",
                    Enabled = false
                });
            }
We tried the same logic with header band, but unfortunetely, it is always 0 at the begining of group (in header after print event). We tried with default counts (count(groupHeaderBand), distinctCount(ColumnName) ), but it does not work, header is being shown.

One thing we noted that if we put a variable text field in header to see the numbers of rows in grouping it works okay (it shows rows in corresponding group). Image attached,

Can you please suggest what we can do about it ?

Your truthful client,
Iskandar A

Re: Remove

Posted: Fri Jul 27, 2018 7:05 am
by IskandarAir
Badly need help.

Re: Remove

Posted: Sun Jul 29, 2018 9:15 am
by Lech Kulikowski
Hello,

Please send us a sample report with test data which reproduces the issue for analysis.

Thank you.

Re: Remove

Posted: Mon Jul 30, 2018 6:55 am
by IskandarAir
Hi,

Please check attachments. Please we do need it urgently.

In MsSQL connection, please customize to your own environment. I am using master and SELECT\UNION ALL. which will work on any sql server database

Regards,
Iskandar A

Re: Remove

Posted: Wed Aug 01, 2018 6:35 am
by Lech Kulikowski
Hello,

In the sent sample, you can use the same Condition for GroupHeader as for band and footer.

Thank you.

Re: Remove

Posted: Wed Aug 01, 2018 11:01 am
by IskandarAir
Hello,

But i tried this obvious approach as i stateed in my first question post. What you say is it true for version 2017.1.6.0 as well?

REgards,
Iskadnar A

Re: Remove

Posted: Wed Aug 01, 2018 11:38 am
by IskandarAir
Dear Lech,

Please find attached and update sample mrt file. The same Condition does not work properly at all.
It seems during procession condition in the headerband the variable is zero. Please pay attention to where we do zerofying of variable (it is in GroupHeader band afterPrint event - tried with beforePrint as well).


You may say that Using detail band's condition can do a trick with groupHeader band - but it is the reason we faced client's request since it does not work even as proper as with Variable

Please attach the working solution, i believe you do testing before replying and that can be useful to us.


Waiting for your response,
Iskandar Anvarov

Re: Remove

Posted: Wed Aug 01, 2018 11:42 am
by IskandarAir
Here is updated mrt result. which is wrong as you see.

Re: Remove

Posted: Sat Aug 04, 2018 12:09 am
by HighAley
Hello.

You could use an additional Data Source from Other Data Source where you can calculate the salary for each group.
Please, look at the attached report template.

Thank you.