Print based on count

Stimulsoft Reports.NET discussion
Post Reply
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Print based on count

Post by Fabio Pagano »

I have a flat table (is the report's data source) that contains the orders data, with the following structure:

Agent | Customer | Order_id

In each row, that represents a single order, i have the agent, the customer and the order_id.

In the report i need to group by agent, then by agent's customers, showing for each agent and customer the count of their orders, then for each customer i must show the detail of the orders id.

Report's structure is as follows:

Group Band (Agent)
Group Band (Customer)
Data band (Orders)

Example or report (i use "code" tag for showing indentation):

Code: Select all

Agent "1": Number of orders: 4
	Customer "A": Number of orders: 3
		Order_Id: 1
		Order_Id: 2
		Order_Id: 3
	Customer "B": Number of orders: 1
		Order_Id: 4

Agent "2": Number of orders: 2
	Customer "C": Number of orders: 2
		Order_Id: 5
		Order_Id: 6
I know how to obtain this.

I ask your kind help because i need to consider only the customers that have a count of orders greater than 2: the total of the agent must consider only the customers effectively printed.

So, if i consider only the customers that have a count of orders greater than 2, the report above should be as follows:

Code: Select all

Agent "1": Number of orders: 3
	Customer "A": Number of orders: 3
		Order_Id: 1
		Order_Id: 2
		Order_Id: 3
Customer "B" of Agent "1" and Customer "C" of Agent "2" are not printed because their count of orders is not greater than 2.

Note that the orders count of the Agent "1" considers only the orders of the Customer "A" that is printed, while the Agent "2" is not printed at all because it has not Customers that have a number of orders greater than 2.

May you kindly help me on how i can accomplish this?

Thank you.
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Print based on count

Post by Fabio Pagano »

I should add that i'm using version 2010.3.900.0 of 2 december 2010.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Print based on count

Post by Alex K. »

Hello,

Please see the sample report in attachment.

Thank you.
Attachments
1662.tst.csv
(66 Bytes) Downloaded 169 times
1661.Report.mrt
(10.21 KiB) Downloaded 375 times
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Print based on count

Post by Fabio Pagano »

In the meantime i've installed the version 2012.1.1213.0 of 23 february 2012.

The datasource you have provided contains the additional "Name1" that contains "OrderID.Count"

Image

I cannot modifiy my datasource structure, outside or inside the report, so it can contain only "Agent", "Customer", "OrderID".

To exclude the customers that have a number of orders lesser than 3, in the customers' group (GroupHeaderBand2) i've added the condition:

"Count(GroupHeaderBand2) < 3" that disables the component (checkbox "Component is enabled" not selected).

It works, but if the GroupHeaderBand1 (Agents' group) has no GroupHeaderBand2(s) groups (customers) under it (because none of its customers has more than 2 orders) i need to not print the GroupHeaderBand1 (agent). In GroupHeaderBand1 (Agents' group) i've added the condition:

Count(GroupHeaderBand2) == 0 that disables the component (checkbox "Component is enabled" not selected)

but the agent is always printed though it has no customers with more than 2 orders, see the screenshot (in red square the agent without any customer).

Image

Is there a way to not print the agents' group if it has not any customer (group) under it, without modifying the original datasource?

If required i can send you the report design.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Print based on count

Post by HighAley »

Hello.

Sorry for the delay with response. We need some additional time to prepare the answer for you.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Print based on count

Post by HighAley »

Hello.
Fabio wrote:In the meantime i've installed the version 2012.1.1213.0 of 23 february 2012.

The datasource you have provided contains the additional "Name1" that contains "OrderID.Count"

I cannot modifiy my datasource structure, outside or inside the report, so it can contain only "Agent", "Customer", "OrderID".
You should create the Data Source from other Data Source like in the report we sent you. And the you could create "OrderID.Count" field.
Please, look at the DataSource2 Edit window.
Then you should create a relation between these two Data Sources.

If you have some additional questions, please do not hesitate to contact us.

Thank you.
Post Reply