luwojtaszek / ngx-excel-export Goto Github PK
View Code? Open in Web Editor NEWAngular6 application with export data to excel file functionality.
Angular6 application with export data to excel file functionality.
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 ?!
Did I want to capitalize the headers, how to do?
I don't want to include all the properties of an object while exporting.Could you please help me on how to exclude the required properties.
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
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.
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
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.
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;
}
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?
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.
Hi,
I was figuring out if we can add graphs/charts or images in Excel using ngx-excel-export. How can we add graph/charts or images to excel using ngx-excel-export? Is there an option to insert those?
Thanks.
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
/**
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?
excel found unreachable content in ''.do you want recover the content
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.