Loop through data in code

Stimulsoft Reports.NET discussion
Post Reply
hackjack
Posts: 6
Joined: Thu May 16, 2013 2:19 pm

Loop through data in code

Post by hackjack »

Hi,

Is it possible to access data directly in code?

My dictionary has multiple levels of ParentRelations

DATEN
-- Relation DATEN.AuftraegeDaten
-- Relation DATEN.AuftraegeDaten.HVFELDER
-- Data Fields...
AUFTRAEGE
-- Data Fields
HVFELDER
-- Data Fields

I have a DataBand setup to loop through "DATEN", grouped by DATEN.AuftraegeDaten. In the code, I would like to create a foreach loop to go through the Relation DATEN.AuftraegeDaten.HVFELDER. Is this possible?

The class definition for HVFELDER shows as "public virtual ParentHVFELDERRelation HVFELDER" - what is this class based on, what are available methods? It does not seem to be implementing Enumeration?

Any ideas?
Thanks,
Jack
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Loop through data in code

Post by Alex K. »

Hello,

It is difficult to say something without a test data. Please try to see the "Hierarchical Reports" category in or Demo.
If it is not suited for your task, please send us a test data and sample how it should look like for analysis.

Thank you.
hackjack
Posts: 6
Joined: Thu May 16, 2013 2:19 pm

Re: Loop through data in code

Post by hackjack »

Hi again,

maybe you misunderstand the question. I want to loop through data in C#, so completely indepedent of the existing DataBands. I'm just missing documentation on how to access the data. Class definitions, available methods etc.

Is there any existing development guide that I could check?

Thanks,
Jack
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Loop through data in code

Post by HighAley »

Hello.

Sorry, but we don't really understand what do you need.
Could you describe your problem more detailed.
It will be great if you will send us a sample project which will help us to understand your issue.

Thank you.
hackjack
Posts: 6
Joined: Thu May 16, 2013 2:19 pm

Re: Loop through data in code

Post by hackjack »

Hi,

I figured out what I need to do, here is my code snipped to manually manipulate or retrieve data from the dataset provided.

Code: Select all

DataTable dt = (DataTable)HVFELDER.DataTable;
DataRow[] result = dt.Select(string.Format("{0} LIKE '%{1}' AND {2} LIKE '%{3}'}", "ID", "1234", "Category", "Superfunhappystuff")); 
foreach (Object item in result[0].ItemArray)
{
      // do something
}
I should be able to access any data in the dataset as required. Of course structural knowledge of the DataSet is needed to avoid Exceptions (or they must be caught).

Thanks and best regards
Jack
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Loop through data in code

Post by HighAley »

Hello.

Do you really need to do all of it in code?
It seems that your issue could be solved with our report components.
there are no dataset in our reports. We use Data Sources.
Did you try to look at Master-detail report?
Master-Detail.mrt
(38.75 KiB) Downloaded 448 times
Thank you.
hackjack
Posts: 6
Joined: Thu May 16, 2013 2:19 pm

Re: Loop through data in code

Post by hackjack »

Hi,

I'm afraid I do - I don't actually want to output the data, but instead format other data based on parameters. I have three DataTables in my source which I combine to loop throug and group the data, and four more tables (at different data hierarchy levels) that define meta-information which I use for conditional formatting.

But my report works fine now.

Thanks and regards
Johan
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Loop through data in code

Post by Alex K. »

Hello,

Ok.
Let us know if you need any additional help.
iren64
Posts: 1
Joined: Tue Feb 06, 2024 2:46 pm

Re: Loop through data in code

Post by iren64 »

Hello . I have a stored procedure with a parameter. I take the parameter value from another procedure. but this stored procedure(from which I am taking parameter value) returns a list and I want to get from this list every parameter in the first stored procedure.
"Reconnecting on every line" didn't help. what can I do? Thanks a lot
Lech Kulikowski
Posts: 6329
Joined: Tue Mar 20, 2018 5:34 am

Re: Loop through data in code

Post by Lech Kulikowski »

Hello,

You should use DataBands.

Thank you.
Attachments
Screenshot 2024-02-07 132827.png
Screenshot 2024-02-07 132827.png (186.28 KiB) Viewed 715 times
Post Reply