Can't display a simple ArrayList collection

Stimulsoft Reports.NET discussion
Post Reply
mostafaxx
Posts: 8
Joined: Mon May 14, 2012 2:37 pm
Location: Egypt

Can't display a simple ArrayList collection

Post 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
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Can't display a simple ArrayList collection

Post 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.

mostafaxx
Posts: 8
Joined: Mon May 14, 2012 2:37 pm
Location: Egypt

Can't display a simple ArrayList collection

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Can't display a simple ArrayList collection

Post 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.
mostafaxx
Posts: 8
Joined: Mon May 14, 2012 2:37 pm
Location: Egypt

Can't display a simple ArrayList collection

Post 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 ?
mostafaxx
Posts: 8
Joined: Mon May 14, 2012 2:37 pm
Location: Egypt

Can't display a simple ArrayList collection

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Can't display a simple ArrayList collection

Post by Alex K. »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.
Post Reply