Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Sir,

Here i am doing windows application.In Mdi form i am using one timer and its interval is 1 Millisecond. It is working continuously. In that timer i am fetching data from Database(Access).

My problem is that when i open crystal report,the entire project is stuck.I can not see the report.

If i disable the timer,then Report is showing properly.
I have run this project in another system also,its showing same problem.In every report also showing same problem.

So please help me to solve this problem.


Thank You
Sujith
Posted
Updated 13-May-11 18:29pm
v2
Comments
ZeeroC00l 14-May-11 0:30am    
-- edited for formatting and added "CrystalReports" tag
thatraja 14-May-11 2:32am    
We must take a look at your code so include that in your question.
sujithmtla 16-May-11 2:51am    
private void timer3_Tick(object sender, EventArgs e)
{
int t = 0;
OleDbCommand cmdGetDateTime = new OleDbCommand("select Date,Time from WakeupCall where Date='" + DateTime.Now.ToShortDateString() + "' and Status='Activated'", Mycon.con);
if (Mycon.con.State == ConnectionState.Open)
Mycon.con.Close();
Mycon.con.Open();
OleDbDataReader rdGetDateTime = cmdGetDateTime.ExecuteReader();
while (rdGetDateTime.Read())
{
//string[] temp = rdGetDateTime.GetValue(1).ToString().Split(':', ' ');
//string minute = "";
//if (System.Convert.ToInt32(temp[1].ToString()) < 10)
//{
// minute = "0" + temp[1];
//}
//string timeout = temp[0].ToString() + ":" + minute.ToString() + " " + temp[2].ToString();
if (rdGetDateTime.GetValue(0).ToString() == DateTime.Now.ToShortDateString() && rdGetDateTime.GetValue(1).ToString() == DateTime.Now.ToShortTimeString())
{
t = 1;
}
}

if (t == 1)
{
//Global.Functions.alert.MdiParent = this;
//Global.Functions.alert.Show();
//Global.Functions.alert.Top = 400;
//Global.Functions.alert.Left = 300;

AlertShow(t);
}


}

private void AlertShow(int s)
{
timer3.Enabled = false;
Global.Functions.alert.Left = 805;
Global.Functions.alert.Top = 440;
Global.Functions.alert.MdiParent = this;
Global.Functions.alert.Left = 805;
if (s == 1)
{
s = 0;
timer4.Enabled = true;


}

}

private void timer4_Tick(object sender, EventArgs e)
{

Global.Functions.alert.Left = 800;
Global.Functions.alert.Top = Global.Functions.alert.Top - 10;
Global.Functions.alert.Show();
System.Media.SystemSounds.Beep.Play();
if (Global.Functions.alert.Top <= 270)
{
timer5.Enabled = true;
timer4.Enabled = false;
timer3.Enabled = true;
}
}

private void timer5_Tick(object sender, EventArgs e)
{
Global.Functions.Count = Global.Functions.Count + 1;
if (Global.Functions.Count >= 60)
{
timer3.Enabled = true;
timer5.Enabled = false;
Global.Functions.Count = 0;
Global.Functions.alert.Hide();
}
}
I didnt set datasource in timer.

1 solution

Are you setting datasource for the report in the timer tick event?
Can u provide the code so that it would be easy to find out the error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900