Excel export custom fields

I need to export to excel a schedule report, but I need custom fields so I want to know if it's possible to change the default fields for the ones I want.

The defaults fields are:
'Id'
'Subject'
'StartTime'
'EndTime'
'Location'

I need to use other fields.

This is the code I'm using

    const exportValuesExportOptions = {
      fields: ['Id''Subject''StartTime''EndTime''Location'],
      fileName: "smth_" 
    };
    this.scheduleObj.exportToExcel(exportValues);

3 Replies

AK Alagumeena Kalaiselvan Syncfusion Team March 6, 2020 12:06 PM UTC

Hi Erick, 

Greetings from Syncfusion support! 

We have checked with your reported case “Excel export custom fields” and you can define the required custom fields through the ExportOptions interface and pass it as argument to the exportToExcel public method of scheduler. We already have a UG sample for this scenario. Refer below link for that 


Regards 
Alagumeena.K 



ER Erick March 6, 2020 04:02 PM UTC

I had already seen that sample.
I'm doing a project in Spanish so I need that fields in that language but when I change them the value is not assigned.

Spanish example
 const exportValuesExportOptions = {
      fields: ['Tarea''FechaInicio''FechaFin'],
      fileName: "smth"
    };
    this.scheduleObj.exportToExcel(exportValues);



English example
 const exportValuesExportOptions = {
      fields: ['Subject''StartTime''EndTime'],
      fileName: "smth" 
    };
    this.scheduleObj.exportToExcel(exportValues);





RV Ravikumar Venkatesan Syncfusion Team March 9, 2020 08:48 AM UTC

Hi Erick, 

Thanks for the update. 

We have validated the reported scenario in Spanish culture but it could be working fine at our end. And the same we have shared the sample for your reference. 

[app.component.ts] 
Define custom fields in Spanish culture like the below in eventSettings model. 

export class AppComponent { 
  @ViewChild('scheduleObj') 
  public scheduleObj: ScheduleComponent; 
  public data: Object[] = <Object[]>extend([], scheduleData, null, true); 
  public selectedDate: Date = new Date(2020, 1, 15); 
  public eventSettings: EventSettingsModel = { 
    dataSource: this.data, 
    fields: { 
      subject: { title: 'Subject', name: 'Tarea' }, 
      location: { title: 'Location', name: 'Ubicación' }, 
      description: { title: 'Descrtiption', name: 'Descripción' }, 
      startTime: { title: 'Start Time', name: 'FechaInicio' }, 
      endTime: { title: 'End Time', name: 'FechaFin' } 
    } 
  }; 
} 

[data.ts] 
Map the custom event fields to the scheduler data source like the below. 

export let scheduleData: Object[] = [ 
    { 
        Id: 1, 
        Tarea: 'Explosion of Betelgeuse Star', 
        FechaInicio: new Date(2020, 0, 6, 9, 30), 
        FechaFin: new Date(2020, 0, 6, 11, 0), 
        Ubicación: 'Spain' 
    } 
]; 


Kindly try the above sample and get back to us If you would need any further assistance. 


Regards, 
Ravikumar Venkatesan 


Loader.
Up arrow icon