This is a migrated thread and some comments may be shown as answers.

Kendo Grid Export to PDF. I need to change the value before export

1 Answer 369 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dima
Top achievements
Rank 1
Dima asked on 21 Sep 2019, 09:00 AM

Hi.

How I can change the value before export data to PDF?
I have a checkbox, and I need to change the format, I want to write YES/NO for checkboxes.
Is it possible to change PDF export to say Yes / No for check-boxes?

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 25 Sep 2019, 01:16 PM

Hi, Dima,

The Kendo UI PDF export adds a special class during the export so you can use that to your advantage in the following way:

  • in the template column, add a span with the Yes/No text (the Kendo Template syntax can be used for that) and a class name of your choice
  • add a rule that this element with your chosen class should be hidden
  • add another rule that when the ".k-pdf-export" class is added, the element with the text should be visible and the checkbox should be hidden

 { template: '#=dirtyField(data,"Discontinued")#<input type="checkbox" #= Discontinued ? \'checked="checked"\' : "" # class="chkbx" /><span class="export-text">#= Discontinued ? "Yes": "No"#</span>', width: 110 },

  <style>
    .k-pdf-export input.chkbx, .export-text  {
      display:none;
    }
    .k-pdf-export .export-text {
      display:inline;
    }
  </style>

Here is a runnable Dojo for your reference:

https://dojo.telerik.com/@bubblemaster/osewUBoQ

Let me know in case you have further questions.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Dima
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or