Blank Report
Posted: Wed Apr 21, 2010 4:48 am
Hi ,
looking some example in the Demo Stimulsoft.Net.2010 i am trying to work out a feature that deny me to go ahead in my report.
I have a database with 3 Data Table :
Country_TBL (CountryCode(PK) (Nvarchar),CountryName);
City_TBL (CityCode(PK) (Nvarchar), CountryCode(FK) ,CityName);
Hotel_TBL (HotelCode(PK)(Nvarchar), CityCode(FK),HotelName,and so on.)
I Create a form with a combo box that bind data from the Country_TBL.CountryCode with this code:
ComboBoxControl1.Control.Items.Clear();
while (!Country_TBL.IsEof)
{
ComboBoxControl1.Control.Items.Add(Country_TBL.CountryCode);
Country_TBL.Next();
}
that populate a Check List Box with all cities refered the Country chosen in the Event SelectedIndexChanged :
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();
}
}
and a Button to choose in the Check List Box the cities :
Hotel_Meals_TBL.Disconnect();
MyVariable = "";
for (int i=0;i<CheckedListBoxControl1.Control.CheckedItems.Count;i++)
{
if (MyVariable == "")
{
MyVariable = " where CityCode in (";
MyVariable += City_TBL.GetData("CityCode",CheckedListBoxControl1.Control.Items.IndexOf(CheckedListBoxControl1.Control.CheckedItems));
}
else
{
MyVariable += "," + City_TBL.GetData("CityCode",CheckedListBoxControl1.Control.Items.IndexOf(CheckedListBoxControl1.Control.CheckedItems));
}
}
if (MyVariable != "")
{
MyVariable += ")";
}
MessageBox.Show(MyVariable);
if (MyVariable == "") MyVariable = " where false";
Hotel_Meals_TBL.Connect();
How you can see i use variable(MyVariable) to bind the list of the cities.In the report there are few fields insert in a DataBand and DataSource = Hotel_TBL; :
City_TBL.CityCode, City_TBL.CityName, Hotel_TBL.HotelName;
When i debug the project and i check the cities i need to populate the Report i click the Button but the report is Blank .
Where i wrong in my code? Do you have any kind of advice to help me to work out this feature?
Thanks for your attention.
Warm Regards
looking some example in the Demo Stimulsoft.Net.2010 i am trying to work out a feature that deny me to go ahead in my report.
I have a database with 3 Data Table :
Country_TBL (CountryCode(PK) (Nvarchar),CountryName);
City_TBL (CityCode(PK) (Nvarchar), CountryCode(FK) ,CityName);
Hotel_TBL (HotelCode(PK)(Nvarchar), CityCode(FK),HotelName,and so on.)
I Create a form with a combo box that bind data from the Country_TBL.CountryCode with this code:
ComboBoxControl1.Control.Items.Clear();
while (!Country_TBL.IsEof)
{
ComboBoxControl1.Control.Items.Add(Country_TBL.CountryCode);
Country_TBL.Next();
}
that populate a Check List Box with all cities refered the Country chosen in the Event SelectedIndexChanged :
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();
}
}
and a Button to choose in the Check List Box the cities :
Hotel_Meals_TBL.Disconnect();
MyVariable = "";
for (int i=0;i<CheckedListBoxControl1.Control.CheckedItems.Count;i++)
{
if (MyVariable == "")
{
MyVariable = " where CityCode in (";
MyVariable += City_TBL.GetData("CityCode",CheckedListBoxControl1.Control.Items.IndexOf(CheckedListBoxControl1.Control.CheckedItems));
}
else
{
MyVariable += "," + City_TBL.GetData("CityCode",CheckedListBoxControl1.Control.Items.IndexOf(CheckedListBoxControl1.Control.CheckedItems));
}
}
if (MyVariable != "")
{
MyVariable += ")";
}
MessageBox.Show(MyVariable);
if (MyVariable == "") MyVariable = " where false";
Hotel_Meals_TBL.Connect();
How you can see i use variable(MyVariable) to bind the list of the cities.In the report there are few fields insert in a DataBand and DataSource = Hotel_TBL; :
City_TBL.CityCode, City_TBL.CityName, Hotel_TBL.HotelName;
When i debug the project and i check the cities i need to populate the Report i click the Button but the report is Blank .
Where i wrong in my code? Do you have any kind of advice to help me to work out this feature?
Thanks for your attention.
Warm Regards