I have a Problem While Creating Crystal Reports
The Exception was
The Exception is:-Exception :: System.InvalidCastException: Unable to cast object of type 'System.Data.DataTable' to type 'System.Data.DataView'.
The crystal Reports Producing code When i click the button was
try
{
System.Data.DataTable table = ((DataView)dataGridViewPOR.DataSource).Table;
POCrystalReport crystal = new POCrystalReport();
crystal.SetDataSource(table);
this.POCrystalReportViewer.ReportSource = crystal;
}
The Exception Raised in the highlighted line .I used this code many times.but exception raisweed this time
please solve my issue.
NagaRaju T
The Exception Raised in the highlighted line .I used this code many times.but exception raisweed this time
please solve my issue.
NagaRaju T


Iftikar HussainRank #423 · 5.9K reputationPosted Jul 27, 2013, 6:15 AM EDT
Try like this
System.Data.DataTable table = (DataTable)dataGridViewPOR.DataSource;
Regards,
Iftikar
NAGARAJU TAMADA134 reputationPosted Jul 27, 2013, 6:22 AM EDT
My reports are generated successfully
Regards
NagaRaju T