Skip to Content
avatar image
Former Member

Table not found Error in CR 8.5

I am using CR 8.5 and set a Procedure(dbo.xxxx) in the location as tables, which I am using for the report.When I execute the report separately, I am getting desired results.When accessed through the application(WPF), I am getting the "Table dbo.xxxx is not found error". The application is accessing the DB with a different login which has the exec access (tested by executing the USP from the SQL Management Studio).

Now help or suggest me to overcome this issue. Below is the C# code.

public void LoadCryUsage(int cid, DateTime startDate, DateTime endDate, DateTime billingdate, int billno)

{

this.Title = "Reports - Usage";

ReportDocument resUsage = LoadUsage(id, startDate, endDate);

crystalReportsViewer1.ShowExportButton = true; crystalReportsViewer1.Owner = this; crystalReportsViewer1.ViewerCore.ParameterFieldInfo = paramFields; crystalReportsViewer1.ViewerCore.ReportSource = resUsage;

}

public ReportDocument LoadUsage(int id, DateTime startDate, DateTime endDate)

{

ReportDocument rptUsage = new ReportDocument();

rptUsage.Load(reportpath + "rptusage.rpt"); rptUsage.SetDatabaseLogon(DBUser,DBPwd,Server32,DBName, true);

ParameterField pfCid = new ParameterField();

pfCid.ParameterFieldName = "@CID";

ParameterDiscreteValue dcItemCid = new ParameterDiscreteValue();

dcItemCid.Value = cid.ToString();

pfCid.CurrentValues.Add(dcItemCid);

pfCid.HasCurrentValue = true;

paramFields.Add(pfCid);

ParameterField pfStartDate = new ParameterField();

pfStartDate.ParameterFieldName = "@STARTDATE";

ParameterDiscreteValue dcItemStartDate = new ParameterDiscreteValue(); dcItemStartDate.Value = startDate; pfStartDate.CurrentValues.Add(dcItemStartDate); pfStartDate.HasCurrentValue = true; paramFields.Add(pfStartDate); ParameterField pfEndDate = new ParameterField(); pfEndDate.ParameterFieldName = "@ENDDATE"; ParameterDiscreteValue dcItemEndDate = new ParameterDiscreteValue(); dcItemEndDate.Value = endDate; pfEndDate.CurrentValues.Add(dcItemEndDate); pfEndDate.HasCurrentValue = true; paramFields.Add(pfEndDate); rptUsage.SetParameterValue("@STARTDATE", startDate.ToShortDateString()); rptUsage.SetParameterValue("@ENDDATE", endDate.ToShortDateString()); rptUsage.SetParameterValue("@CID", cid);

LogOnInfoT(rptUsage.Database.Tables); //Apply TableLogOnInfo information

return rptUsage;

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 28, 2016 at 03:08 PM

    Hello,

    I changed the Primary Tag to CR for VS.

    CR 8.5 has been out of support for 10+ years. Time to upgrade your reports and your project.

    First issue, CR 8.5 uses old legacy DB connectors that were all completely re-written in CR 9.

    Second issue is CR 8.5 never had a .NET WPF viewer component.

    To get updated first get CR 2016 and open each Report and update the database connection. NOTE: No SDK packages are included in CR Designer installs now.

    Be aware CR 8.5 did not support side by side installs so you cannot have any other version of CR on the same PC as you have CR 8.5 on.

    You must install CR 2016 on a clean PC, first install VS 2010 or above and then install CR and then the Integration EXE into VS.

    To get the Free .NET SDK for CR for VS go here, install the first link and do not install the runtime only redist packages on your DEV PC.

    https://blogs.sap.com/2010/12/07/sap-crystal-reports-developer-version-for-microsoft-visual-studio-updates-runtime-downloads/

    Now update your WPF app to use the CR for VS WPF viewer.

    I do suggest you use the CR.Windows.Form, it is much more capable than the WPF viewer is, WPF is relatively new so it's not as capable as the Windows Form Viewer is.

    Don

    Add comment
    10|10000 characters needed characters exceeded