Blank Report

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

Blank Report

Post by jjc »

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
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Blank Report

Post by Jan »

Hello,

It very hard to say something without your report and your data. it possible to have sample project (or sample report) with sample data where this problems occurs? Can you send it to support@stimulsoft.com.

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

Blank Report

Post by jjc »

Hi Jan,
Thanks for your fast reply.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Blank Report

Post by Ivan »

Hello,

Please do following:
1. FieldValues must be in quotes, for example:

Code: Select all

SELECT * FROM Persons WHERE LastName IN ('Hansen','Pettersen')
2. The DialogResult property of ButtonControl1 should be set to OK.

Please check the "TestReport modified.mrt" in attachment.

Thank you.
Attachments
401.TestReport modified.zip
(2.95 KiB) Downloaded 205 times
jjc
Posts: 97
Joined: Mon Apr 19, 2010 10:14 pm

Blank Report

Post by jjc »

Thanks Ivan,
that's right now,its works well!!!

Thanks for your support :biggrin: .

Good work!!
Post Reply