cancel
Showing results for 
Search instead for 
Did you mean: 

Error When Adding CrystalReportViewer to Web Form

mortodestructo
Explorer
0 Kudos

Hey, all - please forgive my inexperience with this, but I don't know what else to do but ask at this point.

I have a web form that I'm trying to drop the CrystalReportViewer control onto in VS2022. However, on each add, it results in just a grey box with the following message:

Error Creating Control - CrystalReportViewer1
Method not found: 'Void CRVsPackageLib.ICRVSConfigWebFile.AddAssemblies(CRVsPackageLib.IServiceProvider, EnvDTE.ProjectItem)'.

I was previously able to successfully create a working report generator in a Windows Forms app.

Any idea what I might be missing? I'm at a loss, and any advice will be greatly appreciated.

mortodestructo
Explorer
0 Kudos

At this time, I've tried:

  1. Copying the aspnet_client folder into the root of my project
  2. Resetting VS 2022
  3. Uninstalling CR runtimes (64 & 32-bit)
  4. Uninstalling CR SP32
  5. Reinstalling CR SP32 without runtimes
  6. Deleting all of my existing references to CR in my project
  7. Readding all of my references to CR from
    C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64\
    with Copy Local set to false.

Most of this I've tried multiple times. Any other ideas, anyone? I've officially wasted 5 working days troubleshooting this issue. Thanks in advance!

mortodestructo
Explorer

No, Aj - Don was right. The error still appears on the object when it's dropped on the form, but it works otherwise.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

You should not have "place" the Viewer manually, if it's not there then you don't have rights to install software or your AV software is blocking the installer.

What version of Windows are you using?

IIS and Visual Studio must be installed before installing CR for VS

Then right click on the Installer and select Run as Administrator:

CR for Visual Studio SP32 64b installer (VS 2022 and above)

Click OK to get the 32 bit runtime installed so you can select X86 or X64 in project Properties.

In the Toolbox select Choose Item and select the CR Viewer.

mmm... interesting, I'm getting the same error now when dropping the Viewer onto the form.

Ignore it and then run the App... It works...

I'll have to ask R&D what's up... I did add that Lib file to the project, made no difference...

Don

mortodestructo
Explorer
0 Kudos

Don,

I finally did just realize minutes ago that the control is actually capable of working - just displaying the error in design view. Being new to Crystal in general though, all of this has been a terrific learning experience for me. Thank you for all your help and patience.

Answers (8)

Answers (8)

Hi Adam,

That's the problem then, that folder gets installed when you install the EXE.

Try reinstalling it and be sure to right click on the EXE and select "Run as Administrator"

If it's still not there then likely cause is you AV or Firewall software is blocking it.

Until you get it installed your app isn't going to work.

And copy just the Viewer folder into your project.

Don

mortodestructo
Explorer
0 Kudos

Okay, my mistake - I DID have an inetpub directory structure on C: that I was unaware of.

So, to clarify, I copy this directory:

C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13\

...into my project - but to the root folder? Where in my project should this directory reside? And are there any additional references to update once its in place?

Thanks again!

mortodestructo
Explorer
0 Kudos

I went ahead and followed some instructions (found elsewhere) that said to place the crystalreportviewers13 folder in the same structure. So, I now have it placed in .\aspnet_client\system_web\4_0_30319\ in my project. Unfortunately, after a clean and rebuild, and restarting VS, the error persists.

I'm going to try another reinstall in the meantime. I'm starting to feel like this may just be a bad install.

Not the right one, it's WEB so you need the WEB Viewer here:

C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319

Copy the whole CR folder into your project

mortodestructo
Explorer
0 Kudos

Don,

I don't have an aspnet_client folder in my inetpub directory structure. Is this a path that I will need to create manually?

Also, when you say the whole CR folder, do you mean

A) C:\Program Files (x86)\SAP BusinessObjects\
B) C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0

or some specific subdirectory of those?

Thanks again for your help. This is incredibly frustrating.

Copy the CRViewer folder into your project, that may fix it.

Are you testing with IISExpress or IIS?

Can you view the report in VS?

In VS and your form does it show the embedded viewer on your page?

mortodestructo
Explorer
0 Kudos

I've copied C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\Crystal Reports 2011\crystalreportviewers into the bin folder of my project and rebuilt, but no luck.

I'm testing with IISExpress.

I don't know if I can view the report yet or not, since the control won't load properly.

VS does not show the embedded viewer. Only a gray box with the error message in my OP.

Thanks for your help!

See my Blog on upgrading your project:

https://blogs.sap.com/2020/10/30/upgrading-a-visual-studio-2008-2019-.net-project-with-the-latest-cr...

VS can be a pain sometimes, it doesn't always redirect to the correct references..

Be sure to set Copy Local to False for all CR assemblies, if you have any in your \bin folder it will cause problems.

mortodestructo
Explorer
0 Kudos

Don,

This is a brand new installation, so there aren't any old references hanging around. All of my CR assemblies are pointed to 13.0.4000.0. I read through blog post for clues as to something I might have missed, but nothing stood out.

However, I did set Copy Local to False for all CR assemblies, and removed the ReportEngine dll from my bin folder (which was the only one that had copied locally apparently). But still no dice. 😞

DellSC
Active Contributor

Did you download and install the 64-bit version of SP32 of the Crystal for Visual Studio SDK? If not, you need to do that. You can find it through the wiki. You need to make sure you download the "install package", which is a .exe file. All of the other downloads are for various versions of the runtimes that you use only when deploying your application.

Once you've downloaded the installer, make sure that

1. Visual Studio is not running.

2. You need to right-click on the installation .exe and select "Run as administrator" in order for the integration with Visual Studio to install correctly.

-Dell

mortodestructo
Explorer
0 Kudos

Dell,

Thank you for the advice. I've reinstalled the 64-bit version of SP32 Crystal for Visual Studio SDK, but the error still persists.

anda134711
Member
0 Kudos

Hi Adam,

I encountered same issue with you. Did you solve this problem yet?

mortodestructo
Explorer
0 Kudos

As I stated in an earlier response, the error only appears in Design View; however, the control works as expected in the debugger and in production. So really it's just a minor annoyance. I was under the impression initially that the control was not working at all.

emirafiq
Member
0 Kudos

Hi Adam,

I encountered same issue with you. Did you by any chance solve the problem?

mortodestructo
Explorer
0 Kudos

No, the error still appears in Design View; however, the control works as expected in the debugger and in production. So really it's just a minor annoyance. I was under the impression initially that the control was not working at all.

0 Kudos

Use ProcessMonitor and look to see where IIS is attempting to load the viewer from.

Usually adding the viewer to the project resolves the issue.

mortodestructo
Explorer
0 Kudos

We're not even getting as far as IIS. I can't drop the control onto a form without getting this error.