Downloading Excel not working on server but working on localhost

Posted by: parmarkinjalk on 8 May 2019, 11:35 am EST

  • Posted 8 May 2019, 11:35 am EST

    Hi

    I have a excel view using wj-sheet.

    <div class="row" id="flexSheet" style="height:400px;" >
    			<wj-flex-sheet control="ctx.flexSheet" >
    				 <wj-sheet name="All Field" items-source="data"></wj-sheet>
    			</wj-flex-sheet>
            </div>
    

    Hi have a download button.

    $scope.exportExcel = function () {
    		var flexSheet = $scope.ctx.flexSheet;						flexSheet.save($scope.selectedClient.clientName+'_All Field Report.xlsx');
    };
    

    When I download the excel sheet on Localhost it works perfectly fine.

    But when I deploy the code to the server and try to download it give the following error.

    Assertion failed in Wijmo: wijmo.c1xlsx requires the JSZip library.

    I am exporting the code as a WAR file and deploying it to server.

    I have the following imports in my HTML and I can see the file in the mentioned directories.

    <!-- Wijmo -->
        <script src="wijmo/scripts/vendor/wijmo.min.js" type="text/javascript"></script>
    	<script src="wijmo/scripts/vendor/wijmo.input.min.js" type="text/javascript"></script>
        <script src="wijmo/scripts/vendor/wijmo.grid.min.js" type="text/javascript"></script>
    	<script src="wijmo/scripts/vendor/wijmo.grid.filter.min.js" type="text/javascript"></script>
    	<script src="wijmo/scripts/vendor/wijmo.grid.sheet.min.js" type="text/javascript"></script>
    	<script src="wijmo/scripts/vendor/wijmo.grid.xlsx.min.js" type="text/javascript"></script>
    	<script src="wijmo/scripts/vendor/wijmo.xlsx.min.js" type="text/javascript"></script>
        <script src="wijmo/scripts/vendor/wijmo.chart.min.js" type="text/javascript"></script>
        <link href="wijmo/styles/vendor/wijmo.min.css" rel="stylesheet" />
        
    	<!-- Wijmo-Angular interop -->
    	<script src="wijmo/scripts/vendor/wijmo.angular.min.js" type="text/javascript"></script>
    
        <!-- wijmo app scripts and styles -->
        <link rel="stylesheet" href="wijmo/styles/custom.css" type="text/css" />
        <link rel="stylesheet" href="wijmo/styles/grid.css" type="text/css" />
        <link rel="stylesheet" href="wijmo/styles/app.css" type="text/css" />
        <link rel="stylesheet" href="wijmo/styles/ribbon.css" type="text/css" />
    	<link rel="stylesheet" href="wijmo/styles/cellStyles.css" type="text/css" 
    
  • Posted 8 May 2019, 11:38 am EST

    I also have this in the HTML

    <script src="http://cdnjs.cloudflare.com/ajax/libs/jszip/2.2.1/jszip.min.js"></script>
    	<script src="wijmo/scripts/c1xlsx.js"></script>
    
  • Posted 9 May 2019, 1:37 am EST

    Hi,

    You need not include the c1xlsx.js file explicitly in your project. Please also include the JSZip file locally same as wijmo files instead of using CDN link because it may be caused an issue if the server is secured (using https)…

    Also, please try to use the 2.5.0 version from the JSZip instead of 2.2.1.

    If the issue persists, please let us know.

    Regards,

    Manish Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels