cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Crystal Reports layout migration

Former Member
0 Likes
2,374

We are now trying to move a client to Win 10, and have a software package that will not load because of CR. I was unable to find a CR 13.0.35 Redist to allow it to load and a CR tech told me my old CR modules were not compatible with Win 10 anyway.

The desktop application was written in Visual Studio 17, and the last functioning CR version seems to be 13.0.35 (because there is a redirect in the config).

I knew I would have to upgrade the source code. I’m now using VS2019 but the source would not load to it! My client is in a hurry, so I downloaded Visual Studio 2017 and downloaded a new copy of CR designated for 2017 (hoping to get a compatible with Win 10 version and I did install “as admin”).I then pulled the source in.At least it runs, but I am having issues with CR.

Installed Version: Community

Visual C++ 201700369-60000-00001-AA815

Microsoft Visual C++ 2017

Application Insights Tools for Visual Studio Package8.14.20131.1

Application Insights Tools for Visual Studio

ASP.NET and Web Tools 201715.9.04012.0

ASP.NET and Web Tools 2017

First, there is a clause in the config file of the source that redirects from CR 13.0.20 to 13.0.35.That was causing “can’t resolve references to CR13.0.35”.

LOG: Redirect found in application configuration file: 13.0.2000.0 redirected to 13.0.3500.0.

LOG: Post-policy reference: CrystalDecisions.CrystalReports.Engine, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304

LOG: Attempting download of new URL file:///C:/Horizon/WSDC/WSDC_sm/WSDC_SM/bin/Debug/CrystalDecisions.CrystalReports.Engine.DLL.

WRN: Comparing the assembly name resulted in the mismatch: Build Number

ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

I looked at the CR DLL’s and they are identified as 13.0.2600.

I altered the redirect clause in the config to:

<bindingRedirectoldVersion="13.0.2000.0"newVersion="13.0.2000.0"/>

(just removing the redirect doesn’t work!)

Once I made this change the code runs until I try to generate the report. The error is different.Now, it at least tries to pull in the CR report design file but promptly blows up.

LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.

LOG: Post-policy reference: CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304

LOG: Attempting download of new URL file:///C:/Horizon/WSDC/WSDC_sm/WSDC_SM/bin/Debug/CrystalDecisions.ReportAppServer.CommLayer.DLL.

LOG: Attempting download of new URL file:///C:/Horizon/WSDC/WSDC_sm/WSDC_SM/bin/Debug/CrystalDecisions.ReportAppServer.CommLayer/CrystalDecisions.ReportAppServer.CommLayer.DLL.

LOG: Attempting download of new URL file:///C:/Horizon/WSDC/WSDC_sm/WSDC_SM/bin/Debug/CrystalDecisions.ReportAppServer.CommLayer.EXE.

LOG: Attempting download of new URL file:///C:/Horizon/WSDC/WSDC_sm/WSDC_SM/bin/Debug/CrystalDecisions.ReportAppServer.CommLayer/CrystalDecisions.ReportAppServer.CommLayer.EXE.

A second clue:

In the VS design area, if I try to open the CR report layout, it can’t open it. I get the below.

Can someone clue me in to what I am facing here? How do I convert my old CR “stuff” to my new VS and CR environment? I have googled this and looked at CR forums, but solutions found have not shed light or worked.

Accepted Solutions (1)

Accepted Solutions (1)

0 Likes

Assembly version should be 13.0.4000.0

Remove and replace all of them in your project and update the web.config or app.config with the same 13.0.4000.0

Former Member
0 Likes

THAT WORKED! Thank you so much. I can't tell you how grateful I am.

Former Member
0 Likes

Another note: I had to do a lot of manual fixing to make this work. I removed the DLL's from the library manually. I then used "Add References" to reinstall the right ones. That didn't do it. I found that I had to manually edit the .proj file to set it to the right version, it still indicated the old one. That got rid of the new compile errors, but it still wouldn't render reports. I had to manually copy the CR DLL's from the bin/debug folder to the bin/release folder. Then, it worked.

Answers (2)

Answers (2)

0 Likes

As Dell mentioned when you install the EXE on your DEV PC you MUST select Run As Administrator so it integrates into VS properly.

You also need a version of VS higher than Express versions.

Don't install the MSI's on your DEV PC, it's not required and does not include the embedded report designer, possible reasn why you see the binary of the RPT file.

So if you are developing using SP 26 but don't want to upgrade the app Server then use the redirect, but you need to do it properly, you are redirecting to the same version:

<bindingRedirectoldVersion="13.0.2000.0"newVersion="13.0.2000.0"/>

See this KBA for proper info: ( use Google to search for it )

2719939 - Crystal Reports for Visual Studio Runtime versioning - side by side ability - what to do with WinFormCRViewer.zip from download WIKI

Your redirect is causing the problem.

But not required if you update your Project and the app server with SP 26.

Don

Former Member
0 Likes

When I installed CR to my newly downloaded VS 2017 I used:

CRforVS13SP26_0-10010309.EXE executed "As Administrator"

(I have 2019 installed and use for new projects but since this project is resistant to importing into 2019 and I want to get my customer going sooner than later I downloaded 2017) I can see that it successfully integrated in my VS Community version because the tools showed up in my tool box.

As I stated, the redirect in my config file was originally from 13.0.2000 to 13.0.3500. That was causing the error that VS couldn't find the DLL's for 13.0.35. I removed the redirects altogether but that caused new but similar errors. It seemed ridiculous but I tried redirecting from 13.0.2 to 13.0.2. It got past the errors and let me run my code. If the redirect is causing my current errors then removing them again will just bring back errors that kill my code sooner.

One interesting thing, when I "Add New" there is no "Reporting" category. There is in my 2019 install. You might be hitting on what is wrong, but I don't think it is the "redirect". Doesn't that just affect the execution of the code? I can't view the layout in the design area. Again, I did execute install of CR using "As Admin".

Former Member
0 Likes

I have returned to VS 2019 and discovered that when I installed CR in to 2017 it must have corrected errors in 2017. Also, now I can open the CR layout in my VS design area. Progress.

I worked through other errors in the import of this code into 2019 not associated with CR and now I can run the code. However, I am still getting an error during execution when I try to render a CR report.

FileNotFoundException: Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.

FULL MESSAGE:

System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.
Source=CrystalDecisions.CrystalReports.Engine
StackTrace:
at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
at CrystalDecisions.CrystalReports.Engine.ReportClass..ctor()
at WSDC_SM.rptPO_HistoryDetail..ctor() in C:\Horizon\WSDC\WSDC_sm\WSDC_SM\rptPO_HistoryDetail.vb:line 25
at WSDC_SM.frmPO_Rpt_History.btnPrint_Click(Object sender, EventArgs e) in C:\Horizon\WSDC\WSDC_sm\WSDC_SM\frmPO_Rpt_History.vb:line 122
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at WSDC_SM.My.MyApplication.Main(String[] Args) in :line 81

Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.

From References:

DellSC
Active Contributor
0 Likes

Two things you need to look at:

1. You need to install the CR for VS runtime on the Windows 10 machine. On the wiki page here, there is are links to download both the current version and older versions back as far as SP18. IIRC, you'll need, at a minimum, SP21. Make sure this gets installed as Administrator. Don't install SP 26 yet - it requires .NET 4.0.

2. If your application is not a web app, find the .exe on the Windows 10 machine. Right-click on it and go to "Troubleshoot Compatibility". This will let you set the application to run as if it were on an earlier version of Windows and might solve the problem without having to upgrade your code immediately.

-Dell

Former Member
0 Likes

Thank you. I did ask the tech to run in compatibility mode but he never got back with me. I will try it myself when I can travel to the site. Not sure when. We are under a government order to "shelter in place".

Any idea why I can't open the report design ("rpt" file) in my VS design area?

DellSC
Active Contributor
0 Likes

When you installed the SDK on the machine with Visual Studio, did you just install the runtime (.msi, .msm, or other non-.exe file)? Or did you install the .exe that provides the integration into VS. Runtimes should not be installed on the developer workstation, just the integrations with VS should be installed. The .exe needs to be run "As Administrator" in order for all of the registry entries to be set correctly. Also, you need at least SP 25 to work in VS 2019.

-Dell