How show the data that i wish

Stimulsoft Reports.NET discussion
Post Reply
jjc
Posts: 97
Joined: Mon Apr 19, 2010 10:14 pm

How show the data that i wish

Post by jjc »

Hi ,i have some features to workout but i don't know if those are possible to do...
The first one feature is i need to choose the records before to send the data to the report ,i explain better my idea i have a ComboBox with a list of Countries and a CheckedListBox1 where bind cities from the ComboBox my purposes is after checked the cities i wish fill with all Services(restaurants,hotels) of the Cities checked in another CheckedListBox2 and at the end in the CheckedListBox2 i check only the records that i need show on the report and with a Button i execute my report.
I repeati don't know if it is possible so if you can helpme to understand if this feature is workable or there is another way to work out this feature .

Thanks so much for your attention.

Have a good day.

Cheers
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How show the data that i wish

Post by Jan »

Hello,

Please check attached report.

Thank you.
Attachments
458.SelectingRows.mrt
(28.11 KiB) Downloaded 189 times
jjc
Posts: 97
Joined: Mon Apr 19, 2010 10:14 pm

How show the data that i wish

Post by jjc »

Hi Jan,
yes i wish do a feature similar to the project you attacked but in my case i have 2 Checkedboxlist the first one is populate from the list of the cities so when i check the cities i need in the second CheckedlistBox i need to populate with the records refering each city that i checked ,i don't know if my question is clear if isn't i will explain you better .

However thanks so much for your fast reply.:blush:

Have a good day.

Cheers
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

How show the data that i wish

Post by Andrew »

Hello,

That would be great if you could explain your task in more details and, if possible, please illustrate it in screenshots or something else. :biggrin:

Thank you.
jjc
Posts: 97
Joined: Mon Apr 19, 2010 10:14 pm

How show the data that i wish

Post by jjc »

Hi Andrew ,
i try to explain better my task,i have a combobox that retrieve a list of Country (from SqlServer Database) in the Event Selected Index Changed i have this code :

Code: Select all

if (ComboBoxControl1.SelectedIndex >= 0)
{
string index = Country_TBL.GetData("CountryCode", ComboBoxControl1.SelectedIndex).ToString();

   	CheckedListBoxControl1.Control.Items.Clear();
	City_TBL.First();

	while (!City_TBL.IsEof)
	{
		if (City_TBL.CountryCode == index)
		{
	
CheckedListBoxControl1.Control.Items.Add(City_TBL.CityCode);
		}
		City_TBL.Next();
	}

}
when i choose the Country in the ComboBox i can fill the CheckedListBoxControl1 with all cities belonging to the Country chosen in the ComboBox so i have another CheckedListBoxControl2 (this component has the function to show all services of transport belonging to the city) my purpose is when i check the cities in the CheckedListBoxControl1 i wish fill the CheckedListBoxControl2 with the services of transport of the cities chosen and i use this code in the Event SelectedIndexChanged of the component CheckedListBoxControl1 but it is not right :

Code: Select all

if (CheckedListBoxControl1.SelectedIndex >= 0)
{
for (int i=0;i<CheckedListBoxControl1.Control.CheckedItems.Count;i++)
{
CheckedListBoxControl2.Control.Items.Clear();
	Transport_TBL.First();
string index = City_TBL.GetData("CityCode", CheckedListBoxControl1.Control.CheckedItems[i]).ToString();
	while (!Transport_TBL.IsEof)
	{
		if (Transport_TBL.CityCode == index)
		{
	
		 CheckedListBoxControl2.Control.Items.Add(Transport_TBL.English_Itinerary);

		}
		Transport_TBL.Next();
	}
}

}
the CheckedListBoxControl2 can't be populate with the services of transport of the cities i chosen.

Hope to be clear or if you need more details i will send you.

Thanks for your help it is appreciate.:blush:

Have a good day.

Cheers
Anton Lozovskiy
Posts: 135
Joined: Tue Aug 11, 2009 9:38 am

How show the data that i wish

Post by Anton Lozovskiy »

Hello,

Please send us a sample report with data, so that we can clearly see your example.

Thank you.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

How show the data that i wish

Post by Ivan »

Hello,

Please modify your code in the SelectedIndexChanged event of CheckedListBoxControl1 component:

Code: Select all

if (CheckedListBoxControl1.SelectedIndex >= 0)
{
	MyVariable1="";
	CheckedListBoxControl2.Control.Items.Clear();
	for (int i=0; i<CheckedListBoxControl1.Control.CheckedItems.Count; i++)
	{
		string vari = CheckedListBoxControl1.Control.CheckedItems[i].ToString();
		Transport_TBL.First();
		while (!Transport_TBL.IsEof)
		{
			if (Transport_TBL.CityCode == vari)
			{
				CheckedListBoxControl2.Control.Items.Add(Transport_TBL.English_Itinerary);
			}
			Transport_TBL.Next();
		}
	}
}
Thank you.
jjc
Posts: 97
Joined: Mon Apr 19, 2010 10:14 pm

How show the data that i wish

Post by jjc »

Hi Ivan,
your code is right ,:biggrin: i can work out this task so well.

Thanks so much for your fast support.

Have a good day.

Cheers :byebye:
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

How show the data that i wish

Post by Andrew »

Great!
Post Reply