Problem with variable
Posted: Fri Sep 19, 2008 6:32 am
Hello,
I have problem with variable. If I assign variable value and run report as preview, it works well. But if I run report in design and I show preview there, variable has not its value. Variable has its default value. :dumb: Why doesn't variable have assigned value?
I tested it also in your sample Variables and there is problem too.
private void button1_Click(object sender, System.EventArgs e)
{
stiReport1.Load("..\\..\\Variables.mrt");
stiReport1.Compile();
//Set Variables
stiReport1["Name"] = tbName.Text;
stiReport1["Surname"] = tbSurname.Text;
stiReport1["Email"] = tbEmail.Text;
stiReport1["Address"] = tbAddress.Text;
stiReport1["Sex"] = rbMale.Checked;
stiReport1["BirthDay"] = dtBirthDay.Value;
stiReport1.Design();
}
private void button2_Click(object sender, System.EventArgs e)
{
stiReport1.Load("..\\..\\Variables.mrt");
stiReport1.Compile();
//Set Variables
stiReport1["Name"] = tbName.Text;
stiReport1["Surname"] = tbSurname.Text;
stiReport1["Email"] = tbEmail.Text;
stiReport1["Address"] = tbAddress.Text;
stiReport1["Sex"] = rbMale.Checked;
stiReport1["BirthDay"] = dtBirthDay.Value;
stiReport1.Show();
}
Regards
Beda
I have problem with variable. If I assign variable value and run report as preview, it works well. But if I run report in design and I show preview there, variable has not its value. Variable has its default value. :dumb: Why doesn't variable have assigned value?
I tested it also in your sample Variables and there is problem too.
private void button1_Click(object sender, System.EventArgs e)
{
stiReport1.Load("..\\..\\Variables.mrt");
stiReport1.Compile();
//Set Variables
stiReport1["Name"] = tbName.Text;
stiReport1["Surname"] = tbSurname.Text;
stiReport1["Email"] = tbEmail.Text;
stiReport1["Address"] = tbAddress.Text;
stiReport1["Sex"] = rbMale.Checked;
stiReport1["BirthDay"] = dtBirthDay.Value;
stiReport1.Design();
}
private void button2_Click(object sender, System.EventArgs e)
{
stiReport1.Load("..\\..\\Variables.mrt");
stiReport1.Compile();
//Set Variables
stiReport1["Name"] = tbName.Text;
stiReport1["Surname"] = tbSurname.Text;
stiReport1["Email"] = tbEmail.Text;
stiReport1["Address"] = tbAddress.Text;
stiReport1["Sex"] = rbMale.Checked;
stiReport1["BirthDay"] = dtBirthDay.Value;
stiReport1.Show();
}
Regards
Beda