Page 1 of 1

about group

Posted: Thu Jun 19, 2014 2:00 am
by lampson
hi,
I hope each class to print one page, how do I set up ?
looking forward to your help , thanks

Code: Select all

 public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            List<ClassInfo> ClassList = new List<ClassInfo>();
            ClassList.Add(new ClassInfo("1", "Class1"));
            ClassList.Add(new ClassInfo("2", "Class2"));
            ClassList.Add(new ClassInfo("3", "Class3"));
            ClassList.Add(new ClassInfo("4", "Class4"));
            ClassList.Add(new ClassInfo("5", "Class5"));

            List<StudentInfo> StudentList = new List<StudentInfo>();
            foreach (ClassInfo cls in ClassList)
            {
                int num =5;
                for (int i = num; i > -1; i--)
                {
                    StudentInfo student = new StudentInfo(cls.ClassName + i.ToString(), cls.ClassName + i.ToString(), cls.ClassID);
                    StudentList.Add(student);
                }
            }
            Stimulsoft.Report.StiReport r = new Stimulsoft.Report.StiReport();
            r.RegData("ClassList", ClassList);
            r.RegData("StudentList", StudentList);
          r.Design();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }

    public class ClassInfo
    {
        public ClassInfo(string classid, string classname)
        {
            ClassID = classid;
            ClassName = classname;
        }
        public string ClassID
        {
            get;
            set;
        }

        public string ClassName
        {
            get;
            set;
        }
    }

    public class StudentInfo
    {
        public StudentInfo(string studentid, string name, string classid)
        {
            StudentID = studentid;
            StudentName = name;
            ClassID = classid;
        }

        public string StudentID
        {
            get;
            set;
        }

        public string StudentName
        {
            get;
            set;
        }

        public string ClassID
        {
            get;
            set;
        }
    }

Re: about group

Posted: Thu Jun 19, 2014 2:13 pm
by HighAley
Hello.

You should create simple Master-Detail report and set the New Page Before property of the Master band.
You could read more in our manual.

Thank you.

Re: about group

Posted: Fri Jun 20, 2014 8:42 am
by lampson
thanks for you help.

Re: about group

Posted: Sun Jun 22, 2014 1:44 pm
by Andrew
Hello,

We are glad to help you!