This is a migrated thread and some comments may be shown as answers.

An error has occured while processing Chart 'chart1'

3 Answers 240 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nada
Top achievements
Rank 1
Nada asked on 24 Mar 2009, 01:28 PM
Dear ....
please can anyone help  me ,
I have report with four parameters (StartDate , EndDate , Count of records , Country )

when I pressed in these parameters , I got The chart
this is my code 

 

 

private

 

void chart1_NeedDataSource(object sender, EventArgs e)

 

{

Telerik.Reporting.Processing.

Chart chart = sender as Telerik.Reporting.Processing.Chart;

 

 

SqlConnection conn = new SqlConnection("Server=(local);Database=UMG;Integrated Security=SSPI;");

 

 

SqlCommand command = new SqlCommand("GetDiagnosisReport", conn);

 

command.CommandType =

CommandType.StoredProcedure;

 

command.Parameters.AddWithValue(

"@Country", this.ReportParameters["Country"].Value);

 

command.Parameters.AddWithValue(

"@FromDate", this.ReportParameters["FromDate"].Value);

 

command.Parameters.AddWithValue(

"@ToDate", this.ReportParameters["ToDate"].Value);

 

command.Parameters.AddWithValue(

"@Count", this.ReportParameters["Count"].Value);

 

 

SqlDataAdapter adapter = new SqlDataAdapter(command);

 

 

DataSet ds = new DataSet();

 

 

try

 

 

 

 

 

{

adapter.Fill(ds);

}

 

catch (Exception ex)

 

{

System.Diagnostics.

Debug.WriteLine(ex.Message);

 

}

 

DataView view = ds.Tables[0].DefaultView;

 

chart.DataSource = view;

 

}

 

but when I got chart without bound any value (there is no ,or empty series)


then I put parameters and press for preview I got this error 

An error has occured while processing Chart 'chart1':
An Unexpected error has occurred. Please review the InnerException for more information how to resolve the problem.


its urgent

thanks in advance

 

3 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 25 Mar 2009, 03:03 PM
Hello Nada,

Most probably the data view which you assign for the DataSource property of the chart does not contain any data. Otherwise it is very unlikely that the chart will show nothing. As we do not have the chart/report definition nor the run-time data and the complete stack trace of the exception we can only guess what is happening. In order to be able to help you with this issue could you please open a support ticket and send us the necessary information. Thank you in advance.

All the best,
Chavdar
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Nada
Top achievements
Rank 1
answered on 30 Mar 2009, 07:48 AM
I have report with three parameters(StartDate , EndDate , Choose Country) ,
I pick parameters as (3/30/2001 ,3/30/2009 ,Yemen )
I obtained the result : Diagnosisname :Ulceroglandular tularaemia
                                  Diagnosiscount :2 as a chart , then I pick another parameters as (3/30/2001 ,3/30/2009 ,Loas )
I obtained result (there is no or empty series ), then I came back to the first choice , I got exception error (
An error has occured while processing Chart 'chart1':
An Unexpected error has occurred. Please review the InnerException for more information how to resolve the problem.
).

My code is : 

private

 

void chart1_NeedDataSource(object sender, EventArgs e)

 

{

Telerik.Reporting.Processing.

Chart chart = sender as Telerik.Reporting.Processing.Chart;

 

 

 

//SqlConnection conn = new SqlConnection("Server=(local);Database=UMG;Integrated Security=SSPI;");

 

 

SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["UMG"].ConnectionString);

 

 

SqlCommand command = new SqlCommand("GetDiagnosisReport", conn);

 

command.CommandType =

CommandType.StoredProcedure;

 

command.Parameters.AddWithValue(

"@Country", this.ReportParameters["Country"].Value);

 

command.Parameters.AddWithValue(

"@FromDate", this.ReportParameters["FromDate"].Value);

 

command.Parameters.AddWithValue(

"@ToDate", this.ReportParameters["ToDate"].Value);

 

command.Parameters.AddWithValue(

"@Count", this.ReportParameters["Count"].Value);

 

 

SqlDataAdapter adapter = new SqlDataAdapter(command);

 

 

DataSet ds = new DataSet();

 

 

try

 

{

adapter.Fill(ds);

 

DataView view = ds.Tables[0].DefaultView;

 

chart.DataSource = view;

}

 

catch (Exception ex)

 

{

System.Diagnostics.

Debug.WriteLine(ex.Message);

 

}

 

 

}


and parameters I put them in design view for the form

thanks in advance




0
Steve
Telerik team
answered on 30 Mar 2009, 03:30 PM
Hello Nada,

As my colleague requested, in order to be able to help you with this issue, please open a support ticket and send us the necessary information we have requested in the previous post. Once we review it, we would be able to provide you with more info.

Sincerely yours,
Steve
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Nada
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Nada
Top achievements
Rank 1
Steve
Telerik team
Share this question
or