Search code examples
javascriptasp.netasp.net-mvccrystal-reportshttp-status-code-406

Failed to load resource: the server responded with a status of 406 (Not Acceptable) ==>promptengine-compressed.js


I am working on Application where we can host Crystal reports and run them from the application. The problem I am having is that when I am trying to run any report is showing blank white screen. but it has crystal reports UI.Print export etc.. but not ruining the report showing this error Like thisenter image description here

Failed to load resource: the server responded with a status of 406 (Not Acceptable) aspnet_client/system_web/4_0_30319/crystalreportviewers13/promptengine-compressed.js

But when I click on the console error it open URL it opens in a new tab after that if I open report again it's work.but client will not gonna do that so i want to fix this issue.

in the whole application, there are two places where we are using this promptengine-compressed.js

one is crv.js

 bobj.crv.config = {
        isDebug : false, 
        scriptUri: null,  // The uri for the viewer script dir (that holds crv.js)
        skin: "skin_standard",
        needFallback: true, 
        lang: "en",
        useCompressedScripts: true,
        useAsync : true,
        indicatorOnly: false,
        resources : { 
            'HTMLPromptingSDK': { isLoaded: false, path: '../Scripts/promptengine-compressed.js' },
          'ParameterControllerAndDeps' : {isLoaded: false, path: '../../parameterUIController-compressed.js'}  
        },
        logging: { enabled: false, id: 0}
    };

other we are referencing on Layout Page

   <script src="@Url.Content("../Scripts/promptengine-compressed.js")" type="text/javascript"></script>

Solution

  • I have resolved the issue:

    The browser is expecting the MIME type for ‘crystalreportviewers/promptengine-compressed.js’ file as ‘application/x-javascript, text/javascript’.

    But in IIS, at Default Web Site/Application (Application) level the MIME type for .js file is application/javascript. Once I made the change I was able to see reports.

    Thanks!

    https://www.experts-exchange.com/questions/28682818/406-Client-browser-IE10-does-not-accept-the-MIME-type-of-the-requested-page.html

    https://www.experts-exchange.com/questions/24977691/MIME-Type-for-Crystal-Reports-IIS-7.html