Recent

Custom Controls Using Angular Material

Git Repo:  https://github.com/yawahang/ohcontrols Features DatePicker (Date Picker, Time Picker, Date Time Picker, and many more) RatingPicker (Vertical, Horizontal, Custom Icons) Select (Single Select, MultiSelect, Single Column, MultiColumn) Recursive Treeview

Kendo Pdf Export

https://stackblitz.com/edit/ng-kendo-pdf-export-kk-12?embed=1&file=app/app.component.ts&view=preview

import { Component } from "@angular/core";
import { products } from "./products";

@Component({
  selector: "my-app",

  template: `
    <div class="example-config">
      <button kendo-button (click)="pdf.saveAs('table.pdf')">
        Save As PDF...
      </button>
    </div>

    <kendo-pdf-export
      *ngIf="reportPdfGrid"
      paperSize="A4"
      margin="2cm"
      landscape="true"
      repeatHeaders="true"
      scale="0.8"
    >
      <table>
        <thead>
          <tr>
            <th *ngFor="let col of columns">{{ col.name }}</th>
          </tr>
        </thead>

        <tbody>
          <tr *ngFor="let dat of gridData">
            <td *ngFor="let colm of columns">{{ dat[colm.name] }}</td>
          </tr>
        </tbody>
      </table>
    </kendo-pdf-export>
  `,

  styles: [
    `
      kendo-pdf-export {
        font-family: "DejaVu Sans", "Arial", sans-serif;

        font-size: 12px;
      }
    `
  ]
})
export class AppComponent {
  public reportPdfGrid: boolean = true;

  public columns = [
    { name: "ProductID" },
    { name: "ProductName" },
    { name: "QuantityPerUnit" },
    { name: "UnitsInStock" }
  ];

  public gridData: any = products;
}

Comments

Top Posts

SQL Server Symmetric Key & Certificate based Encryption With AES_256 Algorithm

Kendo Grid Angular Column Width, minResizableWidth dynamic

Kendo Grid AutoFit Columns