コード例 #1
0
    private string CreateExport(DataTable filtered_data, string company_name)
    {
        DateTime now = DateTime.Now;

        // Initializing the column names for the export.
        string[] column_names =
            new string[] { "Employee ID", "Employee Name", "Punch Date", "In Time", "Out Time", "Status", "Company Name", "Branch Name", "Department Name", "Category Name", "Shift Name" };

        //string
        //    user_id = HttpContext.Current.Session["employee_id"].ToString(),
        //    file_name = "DailyAttendanceReport-" + user_id + "-" + now.ToString("yyyyMMdd_HHmmss") + ".xlsx";

        string importFile,
               user_id    = HttpContext.Current.Session["employee_id"].ToString(),
               exportPath = "DailyAttendanceReport-" + user_id + "-" + now.ToString("yyyyMMdd_HHmmss") + ".xlsx";

        importFile = "DailyAttendanceReport_Template" + ".xlsx";

        string importFilePath = HttpContext.Current.Server.MapPath("~/exports/templates/" + importFile);

        ExcelExport.ExportDataToExcelWithLogo(importFilePath, "DAILY ATTENDANCE REPORT", filtered_data, Context, column_names, company_name, exportPath);


        //ExcelExport.ExportDataToExcel(exportPath, "DAILY ATTENDANCE REPORT", filtered_data, Context, column_names, company_name);

        return(exportPath);
    }
コード例 #2
0
    private string CreateExport(DataTable filtered_data, string company_name)
    {
        DateTime now = DateTime.Now;

        // Initializing the column names for the export.
        string[] column_names =
            new string[] { "Punch Date", "Employee ID", "Employee Name", "Branch", "Category", "Shift In", "Punch In", "Punch Out", "Shift Out", "Hours Worked", "Status", "OT", "Late By", "Early By", "Remarks" };

        string importFile,
               user_id    = HttpContext.Current.Session["employee_id"].ToString(),
               exportPath = "DailyPerformanceReport-" + user_id + "-" + now.ToString("yyyyMMdd_HHmmss") + ".xlsx";

        importFile = "DailyAttendanceReport_Template" + ".xlsx";

        string importFilePath = HttpContext.Current.Server.MapPath("~/exports/templates/" + importFile);

        ExcelExport.ExportDataToExcelWithLogo(importFilePath, "DAILY PERFORMANCE REPORT", filtered_data, Context, column_names, company_name, exportPath);

        return(exportPath);
    }