This is a migrated thread and some comments may be shown as answers.

First element in nested list in textbox

1 Answer 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Attila
Top achievements
Rank 1
Attila asked on 06 Nov 2013, 06:55 PM
HI

I have a class

public class LeaveDaysData
    {
        public KozpontiFelhasznaloProfilItem User {get; set;}
        public List<DateTime> Datum {get; set;}

        public LeaveDaysData()
        {
            Datum = new List<DateTime>();
        }
    }

List<LeaveDaysData> is the the datasource of my List in report. In report I need to display the first and the last element of the nested Datum List, but if I put one more List and bound datasource to the Datum list it displays first elements date as the first and last element, and it repeats as much elements are int he list.

thnx

1 Answer, 1 is accepted

Sort by
0
Attila
Top achievements
Rank 1
answered on 06 Nov 2013, 07:23 PM
I wrote my own functions

public static string FirstDay(List<DateTime> _items)
        {
            DateTime item = _items.First();
            return item.Year + "." + item.Month + "." + item.Day + ".";
        }

        public static string LastDay(List<DateTime> _items)
        {
            DateTime item = _items.Last();
            return item.Year + "." + item.Month + "." + item.Day + ".";
        }

and from reporting I call

=FirstDay(Fields.Datum)

it returns for me the first and the last element form the list as string because I was needed to format in different format

I hope I helped
Tags
General Discussions
Asked by
Attila
Top achievements
Rank 1
Answers by
Attila
Top achievements
Rank 1
Share this question
or