Code Monkey home page Code Monkey logo

angular-csv-ext's Introduction

Metrics

๐Ÿ“ซ How to reach me:

alhazmy13.net alhazmy13 | YouTube alhazmy13 | Twitter alhazmy13 | LinkedIn

angular-csv-ext's People

Contributors

abhishekgithub7 avatar ahmed-anas avatar alhazmy13 avatar arf1980 avatar buu700 avatar davorpeic avatar hukacode avatar javiertelioz avatar jmann-tw avatar leonadorivaldo avatar makotoishida avatar petervarkoly avatar ryndm avatar sn123 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-csv-ext's Issues

How to exclude a column

Is there a way to exclude a column from export option ? and also can i make header as bold?

Handling Null Values

There should be a method to handle Null values as giving out null seems abrupt in an excel file, Is there a way to do it or else

npm 1.0.0

Can you publish 1.0.0 to npm so we can get past this npm warning?

npm WARN [email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.

Angular 8 support

I upgrading to Angular 8 and I get the following error

Package "angular5-csv" has an incompatible peer dependency to "rxjs" (requires "^5.5.2", would install "6.5.2").

Do you support Angular 8?

Need it on button click

Hi ,
I want to download grid data as csv on click of button like :-

public downloadCsv() {
       //new Angular5Csv(this.data, 'My Report');
   }

Now tell me how to do this bez it is giving issue on new keyword. [unused expression, expected an assignment or function call (no-unused-expression)]

Add charts/graphs to Excel using angular5-csv

Hi,

I was figuring out if we can add graphs/charts in Excel using Angular5-csv. How can we add graph/charts to excel using Angular5-csv? Is there an option to insert graphs?

Thanks.

Create CSV with multiple headers

Trying to create an CSV file with multiple headers. Is there a way for this feature using this package.
Any help will be greatly appreciated.

Thanks.

Upgrade Angular 6 to 7; get error with this package

ng update @angular/cli @angular/core

Package "angular5-csv" has an incompatible peer dependency to
"@angular/core" (requires "^5.0.0" (extended), would install "7.0.1").
Package "angular5-csv" has an incompatible peer dependency to
"@angular/http" (requires "^5.0.0" (extended), would install "7.0.1").
Incompatible peer dependencies found. See above.

solution: npm remove angular5-csv

How can i use it as NPM Package

import { AngularCsv } from 'angular-csv-ext/dist/Angular-csv';

instead of refering to Dist every time, how can i use it as npm package ?

TS7016

Hi,

I have faced with next error:
TS7016: Could not find a declaration file for module 'angular5-csv/Angular5-csv'.

Could you add declaration in d.ts file ?

Thank you!

Json members that are decimals getting cut off

when exporting a dataset that has a float or decimal, it appears that this is truncating the numbers:

for example, we have a dataset field that follows a 7.5 pattern i. e 1234567.12345 in the csv, it appears like this '

231380.0023

where the above number should be 231380.00231

or if the number after the decimal place starts with 0, it completely removed everything after the decimal, for example,

it should be this:
2071090.00005

but getting this:
2071090

our dataset even though it looks like a float, this pattern is actually a string from the api

Show labels option does not work

The show label option as per the read-me file is supposed to print the headers with the key values of but it does not do anything

How to add another header with one row in Angular5Csv generated Csv in Angular5?

I have a custom component in Angular5 application named data-graph component. In that custom component i received data which i am exporting to Csv using Angular5Csv angular package which is downloading instantly on button click correctly. Here is that clicked function code from data-graph.component.ts

import { Angular5Csv } from 'angular5-csv/dist/Angular5-csv'
exportToCsv() { let fileName = this.sensors[0].meter.name + 'Sensors Report'; this.sensorsData.map(item => { if (item._id) { delete item._id; } item.Time = new Date(item.date).toLocaleString(); delete item.date; }) this.customData = this.sensorsData; let fields = Object.keys(this.customData[0]); var options = { fieldSeparator: ',', decimalseparator: '.', title: '', showLabels: true, showTitle: true, noDownload: false, headers: fields, }; new Angular5Csv(this.customData, fileName, options); let anotherCsv = new Angular5Csv(this.customData, fileName, options); }

This exports a csv with data and headers very correctly in this format :

 `F1      C1      P1        Time
 10.0   12.54    9.32   2/26/2019, 2:08:22 PM
 08.32  12.54    2.32   2/26/2019, 2:08:24 PM
 05.01  12.54    5.32   2/26/2019, 2:08:27 PM
 11.0   12.54    6.32   2/26/2019, 2:09:22 PM`

But i want to add another header with one row like this :

`Min     Max    Average
F1   05.01  11.0     09.32
C1   02.66  15.04    10.65
P1   2.32   6.32     3.44`

`F1      C1      P1        Time
10.0   12.54    9.32   2/26/2019, 2:08:22 PM
08.32  15.04    2.32   2/26/2019, 2:08:24 PM
05.01  04.33    5.32   2/26/2019, 2:08:27 PM
11.0   02.66    6.32   2/26/2019, 2:09:22 PM`

How can i achieve this result using angular5Csv?

Uncaught ReferenceError: exports is not defined at Angular-csv.js:2 / Angular 8.2.3

Hi Everyone,

I use this library with angular-8.2.3 and this is working fine, but i get this script-error on app bootstrapping:

Uncaught ReferenceError: exports is not defined at Angular-csv.js:2

I was importing this Library over angular.json:

{
  "projects": {
    ..
    "architect": {
      ..
      "build": {
        ..
        "scripts": [
          ..
          "node_modules/angular-csv-ext/dist/Angular-csv.js"
        ]
      }
    }
  }
}

Did not found a easy solution for that until now :-(

Any recommendations?

Thanks,
Robin

Export CSV exports also Array prototype

If you add any methods on Array/Object prototype then the for in loop from getBody() method will try to export it.
https://github.com/alhazmy13/angular-csv-ext/blob/master/Angular-csv.ts#L136

As a fix I would suggest using the hasOwnProperty method to avoid iterate over inherited properties, or maybe use Object.keys() and iterate over them to fully avoid for in loop

How to reproduce:

Array.prototype.myFunct = function () { return this; }

const data = [1, 2, 3];
new AngularCsv(data, 'My Report');

// the output will be a CSV file with
// 1, 2, 3, function () { return this; }

For moment, as a hack workaround I override the toString() method for prototype functions:

Array.prototype.myFunct = myFunct;

function myFunct() { return this; }
myFunct.toString = () => '';

DateTime Formatting

Hi, in my data I have a DateTime column that is getting serialized into a JSON string. Is there any way to de-serialize this in the module please as when you open the file in Excel or Numbers it is stuck in the JSON format?

The file format and extension of '.csv' doesn't match

Hi there,

I'm getting the issues when I open the csv file, it gives me those error message:

When I try to open it, I get:
1

After I click 'Yes', I get:
2

After I click 'OK', I finally get the correct csv

how can I make them disappeard?

Angular 8 support

I am using angular5-csv version 0.2.11 and while trying to upgrade to Angular 8, it throws below error:

Package "angular5-csv" has an incompatible peer dependency to "@angular/core" (requires "^5.0.0" (extended), would install "8.0.0").

Also, seems like angularcsv-5 has dependency on rxjs 5.x. ON upgrade page, Angular team has suggested to migrate to rxjs 6.x for angular 8.

Package "angular5-csv" has an incompatible peer dependency to "rxjs" (requires "^5.5.2", would install "6.5.2").

Thanks.

not actual Headers getting added passed but ainstead of that array index.

options = {
fieldSeparator: ",",
quoteStrings: '"',
decimalseparator: ".",
showLabels: true,
showTitle: true,
headers: ["First Name", "Last Name", "ID"]
};
new Angular5Csv(this.data, "My Report", this.options);

this.data = [
  {
    name: "Test 1",
    age: 13,
    average: 8.2,
    approved: true,
    description: "using 'Content here, content here' "
  },
  {
    name: "Test 2",
    age: 11,
    average: 8.2,
    approved: true,
    description: "using 'Content here, content here' "
  },
  {
    name: "Test 4",
    age: 10,
    average: 8.2,
    approved: true,
    description: "using 'Content here, content here' "
  }
];

CSV will be like

My Report

0,1,2
"Test 1",13,8.2,TRUE,"using 'Content here, content here' "
"Test 2",11,8.2,TRUE,"using 'Content here, content here' "
"Test 4",10,8.2,TRUE,"using 'Content here, content here' "

[NFR] Hyperlink as a value

Hi, I would like to add a hyperlink as a value to a column I'm creating, anyway doing it? Can't see it in the documentation

Random column order?

Hey, I was wondering what this library's algorithm is for ordering columns when exporting. On my end it seems to be random. Is there a way to assign a specific order for them to appear in in the CSV file?

Do you support nested data?

If there is nested structure in the data, how will it be transferred into csv?

var data = [{
name: "name1",
nested: {
nestedName: "nestedName1"
}
}];

Getting "My Report" in File

Hi ,
I am Getting "My Report" on file which is downloading but it is not anywhere .I want to remove that and add some other part which will come dynamically from Api .
From Where i Can do this ?

Angular 6.x Peer Dependency Warning from npm

Versions
"@angular/core": "^6.0.2",
"@angular/http": "^6.0.2",
"rxjs": "^6.0.0",

Repro steps
npm i

Observed behavior
npm WARN [email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/http@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of rxjs@^5.5.2 but none is installed. You must install peer dependencies yourself.

Desired behavior
No peer dependency warnings/errors from npm by using the angular5-csv.

Mention any other details that might be useful

  "peerDependencies": {
    "@angular/core": "^5.0.0",
    "@angular/http": "^5.0.0",
    "rxjs": "^5.5.2"
  },

I can use angular5-csv in Angular 6, but give this npm warn because of above peerDependencies...

When module failed it causes app down

Hi I'm a user of this csv module and really appreciate you developed this angular5-csv module. It helps a lot.
Yesterday I'm experiencing error with this module. It said cannot find this module. It causes my company's website down in production. So I'm asking is there a way to prevent this from happening ? Or could I do any configuration of webpack for the failure tolerance ?
Thanks

NPM is screwed up? Getting test data in download

Hi,

It looks like your index.js in the NPM module is currently set to be your test example, as follows:

const Angular5Csv = require('./dist/Angular5-csv.js').Angular5Csv;

const data = [
    {
        name: "Test 1",
        age: 13,
        average: 8.2,
        approved: true,
        description: "using 'Content here, content here' "
    },
    {
        name: 'Test 2',
        age: 11,
        average: 8.2,
        approved: true,
        description: "using 'Content here, content here' "
    },
    {
        name: 'Test 4',
        age: 10,
        average: 8.2,
        approved: true,
        description: "using 'Content here, content here' "
    },
];

new Angular5Csv(data, 'My Report');

So any call to the library is just downloading that test data! A bit of showstopper...

How to download the csv file?

How to download the file?

my code

var options = {
          fieldSeparator: ',',
          quoteStrings: '"',
          decimalseparator: '.',
          showLabels: true,
          showTitle: true,
          title: 'Your title',
          useBom: true,
          noDownload: true,
          headers: ["id", "title", "sort_order"],
          nullToEmptyString: true,
        };
        this.myfile = new Angular5Csv(response, 'My Report', options);

Missing column empty string

How do I change the missing column string from 'undefined' to blank.

I have nullToEmptyString: true,

CSV output is

Region,2014,2015,2016,2017,2018,2019,2020
"Africa",0.1,undefined,0.2,0.3,0.2,0.9,undefined

How to add New line character.

I am passing a long string in the title in the options.

How can I break the line so my Title should be displayed in the multiple lines?

Happy coding!! Thanks!

different rows

probably is me but in the csv all the row are in one cell how i can divide in multiple cell like
a b c
name surname email
// // //

not only in one

possibile?

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.