- [C#] Hướng dẫn convert HTML code sang PDF File trên NetCore 7 Winform
- [C#] Hướng dẫn viết ứng dụng chat với Gemini AI Google Winform
- Hướng dẫn khóa file bằng nhiều process id, không cho xóa tập tin
- Hướng dẫn cách tạo Product Id cho ứng dụng phần mềm XXXXX-XXXXX-XXXXX-XXXXX
- [SQLSERVER] Hướng dẫn tạo script sql từ ứng dụng Sqlserver management Studio
- [C#] Hướng dẫn sử dụng thư viện AutoITx lấy id và password Ultraviewer trên winform
- [VB.NET] Hướng dẫn lấy thông tin tài khoản đăng nhập windows và khởi động lại ứng dụng ở chế độ Administrator
- [C#] Sử dụng thư viện Polly gửi lại request api khi request bị lỗi hay rớt mạng
- [DEVEXPRESS] Chia sẻ source code tạo báo cáo report in tem nhãn label trên C# winform
- [DEVEXPRESS] Hướng dẫn vẽ biểu đồ Bar Chart trên Winform
- [C#] Tạo form đăng nhập và đăng ký với hiệu ứng Sliding Animation Effect
- [C#] Hướng dẫn tạo thanh toán đơn hàng qua mã vạch VietQR sử dụng API PayOS hoàn toàn miễn phí
- [C#] Hướng dẫn ghi log ra RichTextBox giống Console trên Winform sử dụng thư viện Serilog
- [C#] Hướng dẫn cách tạo mã QR Code trên file Excel
- [VB.NET] Gởi tin nhắn và file đính kèm qua ứng dụng gởi tin nhắn Whats App
- [C#] Viết ứng dụng Auto Fill list Textbox from clipboard Winform
- [TOOL] Chia sẻ phần mềm thay đổi thông tin cấu hình máy tính
- [C#] Hướng dẫn Export dữ liệu ra file Microsoft Word Template
- [C#] Chia sẻ source code tool kiểm tra domain website
- [C#] Hướng dẫn tạo file PDF sử dụng thư viện QuestPDF
[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!