Bold report - Sum value if true group by item

Hi

I will explain my structure.

I have a dataset like this (is a union between 2 tables)


And result is  this. For each record in the second table, repeat the header data from table 1



In design it is grouped by "formula" and "Id"



The result  is OK. In the header appear only once (table 1) and  below appear all rows (table2)



Now I want to sum or count a column called "Acabado" (of type bit) when it is a 1 grouped by "formula".


With this expression I am not grouped by formula, the sum of all the rows appears.


How 


9 Replies

MR Manoranjan Rajendran Syncfusion Team June 30, 2021 05:26 AM UTC

Hi Ainhoa Erkizia,
,
We have validated your requirement. If you want show the total count of your “formula” field. We suggested you use id field in your expression instead of Acabado and remove the recursive. Please refer to the below expression.

Expression:
=”Total Acabado” & Count (Fields!id.Value,”Formaula2” )



If above suggested solution was not your requirement. Could you please share the additional details of your requirement?


Regards,
Manoranjan R




AE Ainhoa Erkizia June 30, 2021 09:43 AM UTC

Thanks for your reply.

I will try to explain better.

The dataset I have is the union of 2 tables of sql. Contains data of the recipes made. Table 1 of sql contains generic information of the recipe and Table 2 contains its ingredients. When joining the 2 tables, the dataset is filled with information from the header repeated as many times as there are ingredients, that is to say, table 1 repeat information many times as there are ingredients. 

Here below the picture.




In designer, i use Group by ID in the header, to avoid generic information of recipe (table1) to be repeated as many times as ingredients (table2) rows. So i put in header of Group ID.

Then I create GROUP "RECIPE" to calculate how many total weight (kg) has been consumed with the same recipe. In the below image show several same recipe but with different weight (kg) value.



Knowing all this,  What I want is to know how many recipes have finished well and how many not.  

Using expression in the footer group by Recipe  Count(Fields!Finished,"Recipe") is not working, because the dataset contains generic informacion of the recipe (table1) repeated as many times as ingredients has the recipe, and I only  want one per recipe to evaluate for aggregate count.




MR Manoranjan Rajendran Syncfusion Team July 2, 2021 01:05 AM UTC

Hi Ainhoa Erkizia, 
 
Thanks for the update, 
 
We are checking with your requirement. We will share you the details for this on or before 5th July 2021.

 
Regards, 
Manoranjan R 



MR Manoranjan Rajendran Syncfusion Team July 6, 2021 02:24 AM UTC

Hi Ainhoa Erkizia, 

We have validated your requirement. Using Count(Fields! N_silo.Value) you can get how many values are finished in table. We have prepared the sample report for your reference. Please check below report.  

Regards, 
Manoranjan R 



AE Ainhoa Erkizia July 8, 2021 10:48 AM UTC

Thanks for your reply.

I also apologize for my misuse of English. I do not know how to speak english very good.


With what you have told me, I can't get it to work so I have opted to try the RDLC.

I have a main RDLC with an RDLC subreport and I need to know how for each record of the main rdlc read a field and I filter in a dataset and add to the subreport.


In subreport object configure this way.



And in Subreport RDLC File, i have this:




When I run in blazor, in main report the data appears OK but in Subreport all the data appears unfiltered. How can I get the "ID" data of each record of the main report to be able to filter in subreport?




I have attached my project.




Attachment: BlazorReportingComponents_fc14f402.zip



MR Manoranjan Rajendran Syncfusion Team July 9, 2021 02:06 PM UTC

Hi Ainhoa Erkizia, 

Thanks for the update. 

We will check and share the details for this on or before 13th July 2021. 

Regards,   
Manoranjan R   



MR Manoranjan Rajendran Syncfusion Team July 14, 2021 12:05 AM UTC

Hi Ainhoa Erkizia, 
 
We have modified the provided sample with your requirement. Please find the sample from below  download link, 
 
 
Sample details: 
You have filter the datasource data using sub report parameter value.  
 
You get parameter values in subreport model and filter the data source. Please refer the below  code snippet: 
 
Get parameter value : 
var param1 = reportOption.SubReportModel.Parameters[0].Values[0]; 
 
Filter the data sources: 
var filterData = datas.Where(datas => datas.ID == Convert.ToDouble(param)); 
 
Sample output: 
 
 
Regards, 
Manoranjan R 



AE Ainhoa Erkizia August 11, 2021 05:27 PM UTC

The problem is solved.

Thank you very much




MR Manoranjan Rajendran Syncfusion Team August 12, 2021 05:36 AM UTC

Hi Ainhoa Erkizia, 
 
Most welcome. Please get back to us if you need any other assistance 
 
Regards,  
Manoranjan R  


Loader.
Up arrow icon