locked
Migrating from VS2003 to VS2005 C# WinForms application using CR RRS feed

  • Pergunta

  • Ok I have a project that was in VS2003 that we are trying to migrate to VS2005.  I have managed to get the project to build successfully and I can view most of my reports.  However, there are one or two of my reports that keep failing with:

    Error 2 Custom tool error: "Code generator 'ReportCodeGenerator' failed.  Exception stack = System.Exception: Load report failed. ---> System.Runtime.InteropServices.COMException (0x800001FD):
    Invalid field name.
       at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
       --- End of inner exception stack trace ---
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
       at CrystalDecisions.VSDesigner.CodeGen.ReportClassWriter..ctor(String filePath)
       at CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator.GenerateCode(String inputFileName, String inputFileContent)" C:\CODE\Report Viewer\Reports\Game Detail.rpt 1 1 Report Viewer

    I've looked at a few forums to figure out the problem but I can't figure it out.  I've tried changing the registry to the ReportPathDirectory, I've tried uninstalling the .NET Framework 1.1 but for some reason these 2 reports will not get past the MyReport.Load(Report) command.  Please help!  Here is a sample of my code:

    MyReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

    try

    {

    crystalReportViewer.DisplayToolbar = true;

    MyReport.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;

    MyReport.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.DefaultPaperSize;

    MyReport.PrintOptions.PaperSource = CrystalDecisions.Shared.PaperSource.Auto;

    MyReport.PrintOptions.PrinterDuplex = CrystalDecisions.Shared.PrinterDuplex.Default;

    string Report = CurDir + @"\" + CurrReport.Text;

    try

    {

    MyReport.Load( Report );

    }

    catch( System.Exception err )

    {

    MessageBox.Show( err.Message.ToString() ;

    }

    quinta-feira, 12 de outubro de 2006 18:08