Page 1 of 1
Can't display a simple ArrayList collection
Posted: Mon Jun 04, 2012 9:14 am
by mostafaxx
hi there,
First of all i want to say that i really started to hate this reporting tool. :redeye: :redeye: :redeye:
i have a simple ArrayList collection
that its member's are of type item_data
which looks like that
Code at past bin
the list is then initialized
Code: Select all
ArrayList items_list = new ArrayList();
items_list.Add(new item_data(0, "LCD Monitor", 50, 2, 100));
items_list.Add(new item_data(1, "ATI vega s3", 20, 2, 40));
items_list.Add(new item_data(2, "Tiger keyboard", 3, 2, 6));
then shown
Code: Select all
StiReport stiReport1 = new StiReport();
stiReport1.RegData("item_data", items_list);
stiReport1.Load(System.Windows.Forms.Application.StartupPath + "\\invoice.mrt");
stiReport1.Show();
the report template i made using the designer looks like that
code at past bin
i really hope someone tell me how to show that collection
Can't display a simple ArrayList collection
Posted: Mon Jun 04, 2012 9:27 am
by Stephan1
Hi,
well it seem's you synchronize your data and then load it again.
FIRST you have to load the Report and then sync the data.
StiReport stiReport1 = new StiReport();
stiReport1.Load(System.Windows.Forms.Application.StartupPath + "\\invoice.mrt");
stiReport1.RegData("item_data", items_list);
stiReport1.Show();
Cheers
Stephan1
And btw there is no need to hate this product, it's a really great reportool.
Can't display a simple ArrayList collection
Posted: Mon Jun 04, 2012 11:37 am
by mostafaxx
FIRST you have to load the Report and then sync the data.
WOW I got that from the official Stimulsoft Reports.Net 2012.1 code examples :waaaht: :waaaht: :waaaht:
any way i changed it as you said and it didn't work also
you can find the whole project here
http://www.4shared.com/rar/fon-IGSY/bus ... _app2.html
build it using the nmake tool you will find it in the visual studio cmd shell or the sdk cmd shell
just type nmake
Can't display a simple ArrayList collection
Posted: Tue Jun 05, 2012 4:32 am
by Alex K.
Hello,
In this case in report template you have data as datasources but in code you are registered data as BO. In this case you need register your BO, design report and save report with BO and then show it.
Thank you.
Can't display a simple ArrayList collection
Posted: Tue Jun 05, 2012 8:02 am
by mostafaxx
how can i register a business object to a report using the report designer ?
i know that i can do
Code: Select all
StiReport stiReport1 = new StiReport();
stiReport1.RegBusinessObject("item_data", items_list);
stiReport1.Design();
but i want to keep that design process away from the code so how can i do that using the designer ?
Can't display a simple ArrayList collection
Posted: Tue Jun 05, 2012 8:50 am
by mostafaxx
Ok every one i'm starting to get some iteration through the collection,
but the report doesn't read the members of the collection if it's a data structure only if it a class ,
i mean
the collection is an ArrayList of item_data
Code: Select all
ArrayList items_list = new ArrayList();
items_list.Add(new item_data(0, "LCD Monitor", 50, 2, 100));
where item_data is a structure the report doesn't read the members of the item_data
however the report will read the members of the item_data if it's a class
Can't display a simple ArrayList collection
Posted: Wed Jun 06, 2012 4:34 am
by Alex K.
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.