- [DEVEXPRESS] Hướng dẫn bật tính năng Scroll Pixcel in Touch trên GridView
- [DEVEXPRESS] Hướng dẫn sử dụng TileBar viết ứng dụng duyệt hình ảnh Winform
- [DEVEXPRESS] Tô màu border TextEdit trên Winform
- [C#] Lấy dữ liệu từ Console Write hiển thị lên textbox Winform
- [C#] Hiển thị Progress bar trên Window Console
- [C#] Di chuyển control Runtime và lưu layout trên winform
- [SQLSERVER] Sử dụng hàm NULL IF
- [C#] Chia sẽ source code mã đi tuần bằng giao diện Winform
- [C#] Flash Window in Taskbar Winform
- Download và Giải nén tập tin File sử dụng Powershell
- [C#] Hướng dẫn cách lấy thông tin đăng nhập tài khoản và mật khẩu web browser trên windows
- [VB.NET] CRUD Thêm xóa sửa tìm kiếm Realtime FireBase
- [C#] Hiển thị thông báo Toast Message trong lập trình Winform
- [C#] Cấu hình định dạng ngày tháng, thời gian trên Windows cho ứng dụng Winform
- [C#] Rút gọn đường dẫn link url với TinyURL API
- [C#] Hướng dẫn cách bo tròn winform with Radius
- [C#] Chia sẽ class BackGroundOverlay Show Modal cho Winform
- [C#] Hướng dẫn Flip Image Winform
- [C#] Invoke là gì? cách sử dụng phương thức Invoke()
- [C#] Hướng dẫn chia sẽ file, folder từ ứng dụng sang Zalo Chat
[DEVEXPRESS] Xuất file PDF từ lịch Schedule Control C#
Xin chào các bạn, bài viết hôm nay mình sẽ tiếp tục viết về Schedule Control trong Devexpress C#. Ở bài này mình sẽ hướng dẫn các bạn cách xuất file PDF từ Schedule Control Month View.
Dưới đây là giao diện Schedule Control MonthView lịch quét thẻ của nhân viên:
Và bây giờ là mình muốn xuất ứng dụng này ra file Pdf, để in và gởi cho nhân viên.
Dưới đây là kết quả sau khi chúng ta in ra được từ lịch quét thẻ.
Tại nút button nhấn btn_ExportPDF
, các bạn viết source code C# bên dưới:
private void btn_exportPDF_Click(object sender, EventArgs e)
{
MonthlyPrintStyle pStyle = schedulerControl1.ActivePrintStyle as MonthlyPrintStyle;
if (pStyle != null)
{
pStyle.AppointmentFont = new Font("Tahoma", 10, FontStyle.Regular);
pStyle.HeadingsFont = new Font("Tahoma", 12, FontStyle.Bold);
pStyle.CompressWeekend = false;
}
string filePath = "Lichquetthe.pdf";
PrintableComponentLink pcl = new PrintableComponentLink(new PrintingSystem());
pcl.Component = schedulerControl1;
pcl.PaperKind = PaperKind.A4Rotated;
pcl.Margins = new Margins(4, 4, 4, 4);
pcl.CreateDocument();
pcl.ExportToPdf(filePath);
if (File.Exists(filePath))
{
Process process = new Process();
process.StartInfo.FileName = filePath;
process.Start();
}
}
Hy vọng bài viết sẽ giúp ích được cho các bạn!
Thanks for watching!