cancel
Showing results for 
Search instead for 
Did you mean: 

After Upgrade to Visual Studio 2015

Former Member
0 Kudos

I have a issue that is killing me !!!!

Environment

Windows 2012 R2

IIS 8.5

CR 2011 (13.0.2000)

Our production web project currently compiled/published in Visual Studio 2012. All reports load and work correctly in viewer with no issues.

We installed VS 2015, moved/imported the project, built/compiled and installed on same server in a different site for testing. With no changes to any code, now all of the reports give the "Invalid report File Path" error.. The viewer looks like it is loading correctly. The error seems to be in the viewer. I have verified the code to make sure nothing changed. I have verified the path and permissions to all the folders (report, temp, etc.). I have also run process monitor and do not see any errors. I actually can see it report being opened and the temp files being created while it attempts to run. I am lost on what to look for next.. Any help wold be greatly appreciated.

Casey

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks Don for the Reply.. We did figure out what this was.. The Dispose statement was deleting the files before they could be viewed.. We removed the dispose and all works as it did before.. Do not know why yet that the statement works differently between service packs but I will find out.. Thanks for all your help..

Casey

0 Kudos

Interesting.....

Must be missing some part of your work flow because your code does really doing anything. You create the report object set it to the viewer and set some properties of the viewer and then dispose the viewer all at the same time....???

So you code does not make sense but it does make sense that commenting out that line it now works...

Don

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks everyone for the replies.. Sorry I was out on another project and now I am back to this.. I think I have attempted everything in these recommendations..  In Don reply I have added those lines to the web.config and did notice the path to the viewer change but that did not correct my issue.. I also talked with the developers and they advised me they changed attempted the page_load event change to page_init but it did not help. I can tell that it is the viewer that is giving this error because it is not the normal stack exception that happens.. I can make that happen by changing the path to the report.The error look like image I inserted. I do not see any errors in Procmon or  Fiddler4.. Not seeing any errors the those apps points me more that it is the viewer doing this.. I am attaching our original code before we made test changes to see if anyone sees anything:

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared

Imports CrystalDecisions.Web

Imports System.Data

Imports System.IO

Imports System.Xml

Imports System.Text

Imports System.Web.Configuration

Public Class RPTReport

    Inherits System.Web.UI.Page

 

    Public spSYS As String = "RPT902"

    Public sSessionID As String = ""

    Public sField2 As String = ""

    Public sExtend As String = ""

    Public RPTName As String

   

    Public MyReport As String

  

    Public MyID As Integer

    Public RPT_nBack As Integer = 0

    Public nUserID As Integer

    Public RPTID As Integer

    Public sDB As String = "SunCoast1"

    Public sSV As String = "elmer"

    Public sDummy As String

  

    '*******************************************************************************************************************

    '*******************************************************************************************************************

    Private Sub RPTReport_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

        Read_SessID()

        nUserID = SessionGetKeyNum("nUserID", sSessionID)

        RPTID = SessionGetKeyNum("RPTID", sSessionID)

        RPTName = SessionGetKeyAlp("RPTName", sSessionID)

     

       

       

        Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument

        rpt.Load(sRPTPath & RPTName, CrystalDecisions.[Shared].OpenReportMethod.OpenReportByDefault)

        rpt.ReportOptions.EnableSaveDataWithReport = True

       

      

        rpt.SetDatabaseLogon(sSQLUser, sSQLPwd, sServer, sDatabase)

      

        rpt.SetParameterValue("@UserID", nUserID)

      

        CrystalReportViewer1.DisplayToolbar = True

        CrystalReportViewer1.HasPrintButton = True

        CrystalReportViewer1.HasExportButton = True

        CrystalReportViewer1.HasToggleGroupTreeButton = True

        CrystalReportViewer1.HasSearchButton = False

        CrystalReportViewer1.Visible = True

        CrystalReportViewer1.ReportSource = rpt

        CrystalReportViewer1.Dispose()

      

    End Sub  'RPTReport_Init

Thanks Again

Casey

0 Kudos

Hi Casey,

In your code rpt.load(...) try hardcoding the report path and name like "C:\Reports\myreport.rpt"

see if that works.

And change the openreportbydefualt to OpenReportByTempCopy, that should be the only one to use, if not it locks the report file from others using it.

Don

former_member188030
Active Contributor
0 Kudos

Hi Casey,

What is the SP level of CR for VS (13). As per supported platforms guide VS 2015 is only supported with CR fr VS SP15. See details and download here.

Download and install Sp 15 install executable on top of VS 2015 and recompile the app.

See if the issue persists.

Thanks,

Bhushan

Former Member
0 Kudos

Hi Bhushan.. Thanks for the quick reply. I am sorry, I should have mentioned that I have done that already. That was one of the first things I checked. I installed SP15 on my development workstation and recompiled but had the same issue with the web viewer.. Not sure if this makes a difference but I am only having issues with the web viewer. My applications/projects I have for the windows platform run and generate reports with no issues.

Thanks

Casey

DellSC
Active Contributor
0 Kudos

With this SP of the SDK you'll need to move the code that keeps the report in a session from the Page_Load event handler where it worked in the past to the Page_Init event handler.

-Dell

0 Kudos

Also, there are issues with 4.x framework and VS 2015 and CR runtime.

If you look at the page using the F12 key you'll likely see the path has \4_6_xxx in it, this is the issue... Folder does not exist.

Check this link out for more info on redirecting the CR viewer to use the correct path in the web.config file:

Don