Page 1 of 1

How show the data that i wish

Posted: Wed Jun 16, 2010 11:04 pm
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

How show the data that i wish

Posted: Thu Jun 17, 2010 3:37 am
by Jan
Hello,

Please check attached report.

Thank you.

How show the data that i wish

Posted: Sun Jun 20, 2010 10:03 pm
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

How show the data that i wish

Posted: Mon Jun 21, 2010 1:08 am
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.

How show the data that i wish

Posted: Mon Jun 21, 2010 4:18 am
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

How show the data that i wish

Posted: Tue Jun 22, 2010 6:17 am
by Anton Lozovskiy
Hello,

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

Thank you.

How show the data that i wish

Posted: Wed Jun 23, 2010 6:21 pm
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.

How show the data that i wish

Posted: Thu Jun 24, 2010 3:45 am
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:

How show the data that i wish

Posted: Thu Jun 24, 2010 9:08 am
by Andrew
Great!