Save two pieces of data to a CSV file and import them into the AG Grid

There is an issue with exporting a grid that contains two and three datas in some cells to a CSV file. The columns for these data do not get exported, leading me to believe that there is a need for special code implementation when writing the columnKeys. Here's the interface I am working with: https://i.sstatic.net/bPolq.png

I have attempted using the append (+) operator without success. Below is a snippet of my code:

import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Grid, GridApi } from 'ag-grid-community';
import { AgGridAngular } from 'ag-grid-angular';
import { DealsService } from '../services/deals.service';
import * as moment from 'moment';
@Component({
  selector: 'app-deals',
  templateUrl: './deals.component.html',
  styleUrls: './deals.component.scss'
})
export class DealsComponent implements OnInit {
  // Rest of the Angular component code here
}

Your assistance on this matter would be highly appreciated. Thank you!

Answer №1

Ensure that your valueGetters are defined with functions similar to those used in cellRenderer (consider omitting the use of <br/>)

According to the information provided in the documentation -

The export functionality will utilize raw values instead of cell renderer results, meaning:

Cell Renderers will NOT be applied.
Value Getters WILL be utilized.
Cell Formatters will NOT be applied (processCellCallback should be used instead).

Answer №2

Our team leverages ag-Grid in conjunction with AdapTable for seamless export capabilities. This feature empowers users to generate custom reports by selecting desired columns with ease.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I am having trouble accessing the value from an Angular 2 service outside of the subscribe function

Within my component, there is a save function that looks like this: save() { var result; //For updating task if (this.task.AllTaskId) { if (this.task.AssignedToCode == null) { this.task.AssignedToCode = "All"; } ...

The data insertion query in MYSQL seems to be malfunctioning

I am facing an issue with inserting data from a form into a database table named "sumation". Despite using PhpStorm IDE, I am getting errors indicating that no data sources are configured to run the SQL and the SQL dialect is not set up. Can anyone help ...

Can you explain the purpose of 'cb' in the multer module

Within the code snippet below, taken from the multer API, both the destination and filename options consist of anonymous functions. These functions contain an argument named cb. I am curious whether these callback functions are defined within the multer ...

The offset value was inconsistent in the desktop version of Firefox

Could you take a look at my code on the fiddle link, Here is the code snippet: <body> <div id="content" style="width:400px; height:110px;"> <svg id="circle" height="300" width="300"> <circle cx="150" cy="150" r="40" st ...

Issues with the Tumblr platform's back-to-top button functionality

I am quite comfortable with HTML and CSS, but I'm struggling to make the 'back to top' button work on my Tumblr page. Can someone please give me a hand? I've included some JQuery code to make the text fade in and out when scrolling (inf ...

Styling pagination using CSS and jQuery

I am looking to display 3 sections in a simple, paginated way that mimics tabs. I am trying to implement the logic where when a pagination item is clicked and has the 'active' class, it should show the corresponding block. However, I am strugglin ...

Creating alerts in Angular using EventEmitter

I am in the process of building an Angular application and I have a requirement to implement alerts. These alerts should be displayed in response to POST/PUT/DELETE requests, showing a success message. Previously, I achieved this by creating a class: expo ...

Obtaining td values from a dynamically generated table can be achieved by utilizing JavaScript

I have searched through many questions, but none of them directly addresses my issue. The scenario in question involves allowing the user to open a jQuery Dialog where a table is generated with data pulled from a database. When the user makes a selection, ...

Switch the view to a grid layout upon clicking

Using bootstrap 5, I've successfully created a list view: <div class="col"> Click to switch to grid/list </div> Below is the content list: <div class="row mt-3 list"> list view ... ..... ....... </div ...

Adding a new property to the Express request object type: what you need to know

Recently, I developed a custom middleware that executes specific logic tasks. It operates by transforming the keys to values and vice versa within the req.body. Both the keys and values are strings, with built-in validation measures in place for safety. T ...

Is there a potential race condition in React when switching between lists?

I'm currently working on setting up a queue system where users can move items between different lists, such as from "available" to "with client". The queue's state is managed in the root React component like this: this.state = { queue: { a ...

Having difficulty sending variables to onreadystatechange

Here is the latest version of the source code: var xhttp = new XMLHttpRequest(); function passVars(var1, var2, var3) { if (var1.readyState == 4) { if (var1.status == 200) { var data = var1.responseText; if (data) { playSuccess ...

JSON object representing a nested class

I am facing an issue while attempting to create a JSON object using JavaScript/jQuery. Specifically, I am trying to get the JSON object for Class A and encountering problems with the value of b1 being undefined. Class A { string test1; B b1; } Class B { ...

Encountering a type error while dispatching actions in a React component using TypeScript

When I submit the form, I encounter a type error dispatch(createNote(data)) in handleSubmit. However, if I dismiss the error and proceed with submitting the data, it gets saved successfully in indexeddb. Error: **Argument of type '(dispatch: Dispatch ...

Dealing with observable errors in Angular 2 beta.12 and RxJS 5 beta.3

Greetings, Currently, I am working with Angular2 beta 12 within VS2015. Upon updating from rxjs version 5.0.0-beta.2 to beta.3, I started encountering several exceptions primarily related to promises. For instance: The property map is not present in th ...

The parameter type '(req: Request, res: Response, next: NextFunction) => void' does not match the type of 'Application<Record<string, any>>'

I'm currently working on an Express project that utilizes TypeScript. I have set up controllers, routers, and implemented a method that encapsulates my controller logic within an error handler. While working in my router.ts file, I encountered an err ...

Error encountered: The middleware being used is not recognized as a function within the Reddit-clone application. This issue arises while fetching data from

I've been troubleshooting my Reddit-inspired app, and I'm struggling to overcome this issue. I've attempted solutions suggested in YouTube tutorials and followed the documentation for this specific issue. My app is built using Redux-Toolkit. ...

Trigger an event on an element upon first click, with the condition that the event will only fire again if a different element is clicked

Imagine having 5 span elements, each with an event listener like ` $('.option1').on("click", function(){ option1() }) The event for option 1 is also the default event that occurs on page load. So if no other options are clicked, you won&apo ...

Is there an easy method for customizing scrollbars?

I'm looking to include an "overflow:scroll" in a navigation div, but the default scrollbar on windows is unattractive. Is there a simple way to customize the scrollbar without having to download extra JavaScript libraries, APIs, and so on? ...

Change the color of the status bar icon in cordova to create the opposite effect

Looking to modify the color of the icons and fonts on my status bar. Similar to the design on Soundcloud... I was able to change the background to white, but now the icons blend in because they are also white Example of Soundcloud's status bar Statu ...