示例#1
0
    protected void ExportResult_Click(object sender, EventArgs e)
    {
        DateTime min = MinDate;
        DateTime max = MaxDate;
        List<WMUserClickResult> list = WMUserClicks.GetResults(min, max);

        if (!General.IsNullable(list))
        {
            string fileName = string.Format("~/share/upload/excel/clicks/{0:yyyyMMdd}_{1:yyyyMMdd}.xlsx", min, max);
            ExcelDocument excel = new ExcelDocument(fileName, null);

            if (excel.CreateExcel(list, "clickResult"))
                FileHelper.DownLoadFile(fileName, MimeType.Excel);
        }
    }