Search code examples
dockercrystal-reports

Docker Container with support for Crystal Reports


I am trying create a Docker image to host my asp.net MVC app that has a dependency on Crystal Reports.

My dockerfile looks like this

FROM microsoft/iis

COPY ./bin/Release/Publish/ c:\\inetpub\\wwwroot

RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]  
RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]

#install Crystal reports runtime
COPY Resources/Files/CRRuntime_64bit_13_0_21.msi . 
RUN powershell.exe -Command Start-Process CRRuntime_64bit_13_0_21.msi -ArgumentList '/quiet' -Wait

The installing of the CRRuntime_64bit_13_0_21.msi fails. I logged onto my container and ran the msi install from powershell and produced a log. Its very long but here are 2 things that stand out:

  1. Error 1904. Module C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64\pageobjectmodel.dll failed to register. HRESULT -2147024770. Contact your support personnel. Action ended 17:20:50: InstallFinalize. Return value 3.

  2. Action ended 17:23:56: INSTALL. Return value 3. MSI (s) (3C:54) [17:23:56:467]: Product: SAP Crystal Reports runtime engine for .NET Framework (64-bit) -- Installation operation failed. MSI (s) (3C:54) [17:23:56:467]: Windows Installer installed the product. Product Name: SAP Crystal Reports runtime engine for .NET Framework (64-bit). Product Version: 13.0.21.2533. Product Language: 1033. Manufacturer: SAP. Installation success or error status: 1603.

The first error does not seem to halt the install.

Any suggestions for troubleshooting this are welcome as are alternative ways of creating the image.

Also, just to confirm. The website loads and runs fine. I just can't use any of the features that require the Crystal Reports dependency.


Solution

  • I'm going to add an additional answer while Peters answer worked perfectly for installing Crystal Reports, I had an additional issue with missing Fonts when exporting to PDF from Crystal Report.

    This is what I've ended up with. The key is the change in the image tag name to be an older version.

    #windowsservercore-1803 required as it has the fonts we need in the report in order to export to PDF
    FROM microsoft/iis:windowsservercore-1803
    
    #install features we need
    RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]
    RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]
    
    #hack in oledlg dll so that Crystal Runtime will install
    COPY Resources/Files/64/oledlg.dll /windows/syswow64/oledlg.dll
    COPY Resources/Files/32/oledlg.dll /windows/system32/oledlg.dll
    
    #copy in Crystal MSI and install. Note it's 64bit version
    WORKDIR c:/temp
    COPY Resources/Files/CRRuntime_64bit_13_0_21.msi .
    RUN powershell.exe -Command Start-Process c:\temp\CRRuntime_64bit_13_0_21.msi -ArgumentList '/quiet /l*v c:\temp\install64.log' -Wait
    
    #Add website files
    COPY ./bin/Release/Publish/ /inetpub/wwwroot
    

    For some reason Microsoft have dropped lots of fonts from version 1803 to 1809. I can only assume to reduce the OS image size.