Page 1 of 1

Programatically adding groups

Posted: Sat Sep 26, 2009 7:16 pm
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

Programatically adding groups

Posted: Mon Sep 28, 2009 4:10 am
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.

Programatically adding groups

Posted: Mon Sep 28, 2009 4:19 pm
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

Programatically adding groups

Posted: Tue Sep 29, 2009 12:42 am
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.