Trouble with business objects
Posted: Wed Oct 10, 2018 3:01 pm
Having a business object with two List<T> properties, I'm having trouble with printing those lists. Instead of printing the first list and then the second one, it prints the first, the second and then AGAIN the first and the second.
Any ideas why this doesn't work?
MRT-File attached, code looks like this:
Any ideas why this doesn't work?
MRT-File attached, code looks like this:
Code: Select all
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
var stiReport = new StiReport();
stiReport.Load("Report.mrt");
stiReport.RegBusinessObject("Foo", new BusinessObject
{
List1 = new List<Foo>
{
new Foo { Number = 1, Name = "Walter"},
new Foo { Number = 2, Name = "Rick"},
},
List2 = new List<Foo>
{
new Foo { Number = 10, Name = "Maura"},
new Foo { Number = 11, Name = "Veronica"}
}
});
stiReport.Dictionary.SynchronizeBusinessObjects(2);
stiReport.Design();
}
}
public class BusinessObject
{
public List<Foo> List1 { get; set; }
public List<Foo> List2 { get; set; }
}
public class Foo
{
public int Number { get; set; }
public string Name { get; set; }
}