Git Product home page Git Product logo

ngx-excel-export's People

Contributors

luwojtaszek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ngx-excel-export's Issues

Module not found: Can't resolve 'xlsx' in 'filelocation\node_modules\cptable-fixed-xlsx-style'

We have tried ServerSideRendering for our web application, so we acheived it using ( https://github.com/axeldelafosse/expo-next-monorepo-example ) custom mono-repo-application which will support both node and next js. While running my build command I am facing this can't resolve xlsx error in cptable-fixed-xlsx-style package.

I'm using nextjs latest version 12 and webpack 5 & cptable-fixed-xlsx-style 0.8.20

Error message in terminal:
../../node_modules/cptable-fixed-xlsx-style/ods.js
Module not found: Can't resolve 'xlsx' in 'filelocation\node_modules\cptable-fixed-xlsx-style'
Did you mean './xlsx'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.

Import trace for requested module:
../../node_modules/cptable-fixed-xlsx-style/xlsx.js
../app/src/components/Applications/Tabs/CreditTransactions.tsx
../app/LoanManagementApp.tsx
../app/App.tsx
./src/pages/index.tsx

We have tried ServerSideRendering for our web application, so we acheived it using ( https://github.com/axeldelafosse/expo-next-monorepo-example ) custom mono-repo-application which will support both node and next js. While running my build command I am facing this can't resolve xlsx error in cptable-fixed-xlsx-style package.

I'm using nextjs latest version 12 and webpack 5 & cptable-fixed-xlsx-style 0.8.20

Erorr message in terminal:

../../node_modules/cptable-fixed-xlsx-style/ods.js
Module not found: Can't resolve 'xlsx' in 'filelocation\node_modules\cptable-fixed-xlsx-style'
Did you mean './xlsx'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.

Import trace for requested module:
../../node_modules/cptable-fixed-xlsx-style/xlsx.js
../app/src/components/Applications/Tabs/CreditTransactions.tsx
../app/LoanManagementApp.tsx
../app/App.tsx
./src/pages/index.tsx

Our next.config.js:
// @ts-check

/**

  • @type {import('next').NextConfig}
    **/

require('events').EventEmitter.defaultMaxListeners = Infinity;

const { withExpo } = require('@expo/next-adapter')
const withPlugins = require('next-compose-plugins')
const withFonts = require('next-fonts')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
})
const withTM = require('next-transpile-modules')([
'app',
'@gorhom/bottom-sheet',
'@gorhom/portal',
'dripsy',
'@dripsy/core',
'recyclerlistview'
])

const nextConfig = {
typescript: {
ignoreBuildErrors: true,
},
compress: true,
webpack: (config) => {
config.resolve.fallback = { fs: false };

return config;

},
}

module.exports = withPlugins(
[
withTM,
withFonts,
withBundleAnalyzer,
[withExpo, { projectRoot: __dirname + '/../..' }]
],
nextConfig
)

../../node_modules/cptable-fixed-xlsx-style/ods.js

/* ods.js (C) 2014 SheetJS -- http://sheetjs.com /
/
vim: set ts=2: */
/*jshint -W041 /
var ODS = {};
(function make_ods(ODS) {
/
Open Document Format for Office Applications (OpenDocument) Version 1.2 */
var get_utils = function() {
if(typeof XLSX !== 'undefined') return XLSX.utils;
if(typeof module !== "undefined" && typeof require !== 'undefined') try {
return require('../' + 'xlsx').utils;
} catch(e) {
try { return require('./' + 'xlsx').utils; }
catch(ee) { return require('xl' + 'sx').utils; }
}
throw new Error("Cannot find XLSX utils");
};

Is there any fix for this?

error in ./node_module/xlsx-style/dist/cpexcel.js

The problem error in ./node_module/xlsx-style/dist/cpexcel.js is import * as FileSaver from 'file-saver'
dependencies a
"xlsx": "^0.12.10",
"xlsx-style": "^0.8.13"

i dev angular 5 frontend run ng serve unsuccessfull

How take column width to my file

Hi Luwojtaszek,

I have a query, I'm trying to give width to my column with the following code, but it does not work for me. Thanks for the reply.

const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json);
this.colSubDiario(worksheet.A1);
private colSubDiario(col: XLSX.ColInfo) {
col.width = 100;
}

Can i export an excel file with complex object

I have edited the person model that is in the example to be like this :

export class Person {
id: number;
name: {
firstname: string,
surname: string
};
age: number;
}

export const PERSONS: Person[] = [
{
id: 1,
name: {
firstname: 'Thomas',
surname: 'Novicky',
},
age: 21
},
{
id: 2,
name: {
firstname: 'Adam',
surname: 'Tracz',
},
age: 12
}
];

is it possible to export ?!

Generate excel sheet wise

Hi,

I got a requirement where, I need to show excel data saved in multiple sheets as follows

In first sheet(Named Staff Details) I need to store the data as follows

Assistant Professor(Heading)
Name Sal
xyz 20000
abc 30000

Associate Professor(Heading)
Name Sal
xyz123 40000
abc123 50000

In Second Sheet(Named Student Details) I need to store the data as follows

Student Details
Name Roll No
xyz 101
abc 102

Can you please help me how to achieve this.

Can't resolve 'fs' in xlsx-style

Hi,
I'm using angular 6 and I can export json data with XLSX using ngx-excel-export.

When I try to style the exported excel document through xlsx-style, I get building errors:

`WARNING in ./node_modules/xlsx-style/xlsx.js
Module not found: Error: Can't resolve 'crypto' in 'D:\Web\node_modules\xlsx-style'

ERROR in ./node_modules/xlsx-style/xlsx.js
Module not found: Error: Can't resolve 'fs' in 'D:\Web\node_modules\xlsx-style'
ERROR in ./node_modules/xlsx-style/ods.js
Module not found: Error: Can't resolve 'fs' in 'D:\Web\node_modules\xlsx-style'`

How can I solve that?

Thanks
PS: I'm not using node or webpack, it's a simple angular application.

Want to Add some content(Like Title) as well with table data .

I am able to download file and view it but i want to add some title,date and some more data with all table data in the File. So How can i do that ?

or we can say we will have array for 1st json and other array for 2nd json. Requirement is like this

selection_106

jszip is not a constructor when write a file using XLSXStyle.write()

Hi, i tried to export by using this blog. I am able to download a file using XLSX.write() but i need to add background color to cell. So, i used XLSXStyle.write(). It is not working. I got below exception. Kindly assist me.

DifferenceComponent.html:222 ERROR TypeError: jszip is not a constructor
at write_zip (xlsx.js:11654)
at write_zip_type (xlsx.js:11770)
at Object.writeSync [as write] (xlsx.js:11784)

I searched more than 6 hours but not got any proper solution.
I checked this blog SheetJS/sheetjs#299. I don't know how to map xlsx.full.min.js instead of xlsx.js. Kindly assist

Its not working in IOS safari

HI

In IOS safari, when we export it, it opens blank page with message
"safari can not download file".

URL looks like blob:https://

Can we have solution for this?

The file is corrupt

I cloned the repository and run it and when trying to open the exported file I get a message saying that the file is corrupt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.