Crystal Report embedded web viewer

Since 2023.1 there is a possibility to open a Crystal Report in a native Crystal Report web viewer which is opened from a standard Origam report tab (iframe).

Configuration needed:
a) Download Origam crystal report service project - https://github.com/origam/origam-crystal-reports-service/
b) configure it to be running under IIS. It has to have run on the same domain as the main Origam app. It can run on a different port. If the main app runs on https, the crystal report service has to run on https as well. The best is to run it at the same IIS site as the main Origam app under an IIS sub application.
c) install both 32 and 64 bit crystal report runtime dll
d) configure app pool - Enable 32-bit applications set to true
e) in web config set the following into <appSettings> element

<add key=baseReportPath value="{path to a folder containing source rpt files}" />
<add key=reportViewerTmpPath value="{path to a folder containing output rpt files}" />

f) in web.config add the following block into <system.webServer/> element - change the value of Access-Control-Allow-Origam and frame-ancestors to a value where the main Origam html client runs. If the app runs at the same origin as the Origam crystal report server, then these two values can be omited.

    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Headers" value="*"/>
        <add name="Content-Security-Policy" value="frame-ancestors 'self' https://localhost:61939" />
        <add name="Access-Control-Allow-Origin" value="https://localhost:61939" />
      </customHeaders>
    </httpProtocol>

g) copy a folder crystalreportviewers13 from the crystal reports distribution (installed e.g. at C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319) into base IIS site directory (into clients/origam/crystalreportviewers13) and make sure it’s possible to be serverd statically. Unfortunatelly, when the Origam crystal report service run runs as a sub application of Origam, the folder has to be copied into main Origam app. Even though there is a setting in web config for it (ResourceUri element), it seems it doesn’t work and it always asks resources from the root path
h) In Origam Architect, open a Report UI action model element or menu report item element and set report format to ExternalViewer.
i) Make sure /ReportViewer path is available for any IP because it’s the path serving crystal report web viewer and is embedded from the Origam app in iframe. Consider IP or other restrictions for the other endpoints called just from Origam server (/Report /PrepareViewer /Print).

That should be all and you should be able to open the configured crystal report in a crystal reports web viewer embedded in the origam report tab.