Hello
Here i have to generate crystal report from sql server data .Here i am working on visual studio 2010 and sap crystal report 2008 on windows 10.
I have installed
CRRuntime_64bit_13_0_12
for crystal report.
When i did same thing on windows 7 it works fine .but when i am going to switch from windows 7 to windows 10 ,then it gives following error
Method not found: 'CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag CrystalDecisions.ReportAppServer.ReportDefModel.ISCRExportOptions.get_ExportOptionsEx()'.
Please help me its very urgent.
thanks
What I have tried:
This is my code
SqlConnection conn=null;
string filename = "";
try
{
conn = new SqlConnection(DataUtil.getconnection());
ReportDocument objRpt = new ReportDocument();
conn.Open();
SqlDataAdapter ad = new SqlDataAdapter();
SqlParameter param;
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "proc_MRNDETAIL_PRINT";
param = new SqlParameter("@MRN_ID", MyGlobale.MRN_ID1);
param.DbType = DbType.Int32;
cmd.Parameters.Add(param);
ad = new SqlDataAdapter(cmd);
MessageBox.Show("AD=" + ad);
MRN_DataSet ds = new MRN_DataSet();
ad.Fill(ds, "MRN");
MessageBox.Show("count" + ds.Tables[0].Rows.Count);
if (ds.Tables[0].Rows.Count == 0)
{
MessageBox.Show("No data Found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
else
{
MessageBox.Show(Application.StartupPath);
objRpt.Load(Application.StartupPath + "/mrnPrint.rpt");
objRpt.SetDataSource(ds.Tables[0]);
objRpt.Refresh();
try
{
string result = Path.GetTempPath();
objRpt.ExportToDisk(ExportFormatType.PortableDocFormat, result + filename + ".pdf");
MessageBox.Show("File exported in temp folder");
System.Diagnostics.Process.Start(result + filename + ".pdf");
ClearAll();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
Console.WriteLine(ex.Message);
ex = null;
}
}
}
catch (Exception ex)
{
ex.ToString();
}
finally
{
conn.Close();
}
When i am going to shows dataset count
i.e
MessageBox.Show("count" + ds.Tables[0].Rows.Count);
it gives count2
Here
objRpt.ExportToDisk(ExportFormatType.PortableDocFormat, result + filename + ".pdf");
it shows this exception
Method not found: 'CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag CrystalDecisions.ReportAppServer.ReportDefModel.ISCRExportOptions.get_ExportOptionsEx()'.
Please help me.