Page 1 of 1

Loop through data in code

Posted: Mon Jun 03, 2013 8:38 am
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

Re: Loop through data in code

Posted: Mon Jun 03, 2013 9:44 am
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.

Re: Loop through data in code

Posted: Mon Jun 03, 2013 11:11 am
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

Re: Loop through data in code

Posted: Mon Jun 03, 2013 1:25 pm
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.

Re: Loop through data in code

Posted: Mon Jun 03, 2013 2:29 pm
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

Re: Loop through data in code

Posted: Fri Jun 07, 2013 7:37 am
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 711 times
Thank you.

Re: Loop through data in code

Posted: Fri Jun 07, 2013 11:46 am
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

Re: Loop through data in code

Posted: Fri Jun 07, 2013 1:31 pm
by Alex K.
Hello,

Ok.
Let us know if you need any additional help.

Re: Loop through data in code

Posted: Tue Feb 06, 2024 2:58 pm
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

Re: Loop through data in code

Posted: Wed Feb 07, 2024 12:29 pm
by Lech Kulikowski
Hello,

You should use DataBands.

Thank you.