Programatically adding groups

Stimulsoft Reports.NET discussion
Post Reply
jlk
Posts: 2
Joined: Sat Sep 26, 2009 7:04 pm
Location: Cleveland, Ohio

Programatically adding groups

Post by jlk »

I can group by fields in my vb .net ultragrid by simply dragging a column header above the grid. You can add multiple columns and get
a nested grouping.

In vb .net code I can determine what columns are being used and their order. I would like to take this information and then customize
my Stimulsoft report accordingly.

For example one has sorted/grouped formulas by their status and type. I would then like to print out the formulas sorted by formula status and the
formula type within the status groups. This is easily accomplished in the designer but I do not know ahead what a user might choose so I need to do it
in code.

How do I create the GROUPS available in the designer using vb .net code?

Is their any place where the Stimulsoft API is available? Using the VS object explorer is quite cumbersome.

thanks,
jlk
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Programatically adding groups

Post by Andrew »

Hello,

Could you please describe your issue in details. Is it correct that you want to know how to use components from the code?

Thank you.
jlk
Posts: 2
Joined: Sat Sep 26, 2009 7:04 pm
Location: Cleveland, Ohio

Programatically adding groups

Post by jlk »

I guess I need to know how to use components but by looking at the vb .designer code stimulsoft creates I see how to actually create a group comonent.

What I do not see is how the apply the grouping conditions to the SQL in order to have the data ordered by the groups I (or the end user)
would choose.

I figure I need to send SQL to the report engine that would produce the grouping. For example:

SELECT Code, Desc, Class, Type,EndUse
FROM Formulas
WHERE Status = "Active"
GROUP BY Type, Class

The problem is I don't know ahead of time what or the number of items will be in the GROUP BY list.

Is there a way to do this:

SELECT Code, Desc, Class, Type,EndUse
FROM Formulas
WHERE Status = "Active"
GROUP BY @groupList

where @grouplist could be (Type) or (Type, EndUse) or (EndUse, Type, Class)


Thinking more about it I guess my problem is reallly an SQL issue. How do I create a GROUP BY variable that will reference a list of different groups?

I'll research this but I would appreciate your feedback on the SQL issue and specifically how to send the above query from code to the report engine.

Thank you,
JLK
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Programatically adding groups

Post by Jan »

Hello JLK,
jlk wrote:I guess I need to know how to use components but by looking at the vb .designer code stimulsoft creates I see how to actually create a group comonent.

What I do not see is how the apply the grouping conditions to the SQL in order to have the data ordered by the groups I (or the end user)
would choose.
Report engine do not use sql queries for groupping data. Report engine use special code for creating groups. It works this way because our report engine can work not only with sql queries. If you need change sql query text you can use variable in sql query. Following code will be accepted:

Code: Select all

SELECT Code, Desc, Class, Type,EndUse
FROM Formulas
WHERE Status = "Active"
GROUP BY {myvariable} 

Thank you.
Post Reply