Click here to Skip to main content
16,019,614 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Here is my code. when I am running the application it through an error

An error occurred during a local report processing the definition of the report is invalid. An unexpected error occurred in report processing. The external component has thrown an exception.


private void frmCoopReportviewer_Load(object sender, EventArgs e)
{
try
{
string strDataSourceName = string.Empty;
foreach (ReportDataSource rds in reportViewer1.LocalReport.DataSources)
{
strDataSourceName = rds.Name.Trim();
}

reportViewer1.LocalReport.DataSources.Clear();

ReportDataSource reportDS = new ReportDataSource("CoopDataSet");
reportDS.Value = _datasourcelist.Rows;

reportViewer1.LocalReport.DataSources.Add(reportDS);


this.reportViewer1.RefreshReport();
}
catch (System.Exception err)
{
MessageBox.Show(err.Message);
}
this.reportViewer1.RefreshReport();
this.reportViewer1.RefreshReport();
}

What I have tried:

I need to display the report. before with the same code, I generate a report and download the pdf also but know I face this problem.
Posted
Updated 14-Oct-20 1:31am
v2

Is
CoopDataSet
ReportDataSource reportDS = new ReportDataSource("CoopDataSet");
is your Dataset name in ReportViewer Design?
 
Share this answer
 
Comments
Member 14769690 12-Oct-20 7:48am    
yes its my Datasource
Member 14769690 12-Oct-20 7:48am    
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MBS.MKTN.Core.UI
{
public class CoopQuryObj
{
private string _AdvertiserName;
private string _ProductName;
private string _ISCILabel;
private string _Script;

public string Cart { get; set; }

public string CopyLength { get; set; }

public string AdvertiserName
{
get { return _AdvertiserName.Trim(); }
set { _AdvertiserName = value; }
}

public string ProductName
{
get { return _ProductName.Trim(); }
set { _ProductName = value; }
}

public string ISCILabel
{
get { return _ISCILabel.Trim(); }
set { _ISCILabel = value; }
}

public string StartDate { get; set; }

public string EndDate { get; set; }

public string Script
{
get { return _Script.Trim(); }
set { _Script = value; }
}
public string StartDates { get; set; }
public string EndDates { get; set; }
}

public class objQueryList
{
private List<coopquryobj> _Rows = new List<coopquryobj>();

public int Count
{
get { return _Rows.Count; }
}

public List<coopquryobj> Rows
{
get { return _Rows; }
}
}
}
Member 14769690 12-Oct-20 7:49am    
---------------------------------------------------------------------------------------
frmCoopReportviewer form;
//try
//{
form = new frmCoopReportviewer(affobjList);
//}
//catch (System.IO.FileNotFoundException ex)
//{
//InfoLogger.LogError(Constants.MX_EventLogSource, "Test", ex);
//using (var downloadForm = new frmReportVeiwerDownload())
//{
// downloadForm.ShowDialog();
// return;
//}
//}
form.ShowDialog();

Here i called Reportviewer by passing that object
Pls replay any one.....................
 
Share this answer
 
Comments
Richard Deeming 14-Oct-20 7:55am    
This is NOT a solution!
Member 14769690 15-Oct-20 4:09am    
An error occurred during a local report processing the definition of the report is invalid. An unexpected error occurred in report processing. The external component has thrown an exception. How I can resolve this erorr

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