Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc Rotativa多重PDF生成_Asp.net Mvc_Rotativa - Fatal编程技术网

Asp.net mvc Rotativa多重PDF生成

Asp.net mvc Rotativa多重PDF生成,asp.net-mvc,rotativa,Asp.net Mvc,Rotativa,我正在使用rotativa生成PDF。我想根据下面列表中的记录数生成多个PDF。代码仅生成一个PDF public ActionResult PreviewPDF(string month,string year) { string basePath = ConfigurationManager.AppSettings["PDFPath"]; string fullPath = string.Empty; string message =

我正在使用rotativa生成PDF。我想根据下面列表中的记录数生成多个PDF。代码仅生成一个PDF

public ActionResult PreviewPDF(string month,string year)
    {
        string basePath = ConfigurationManager.AppSettings["PDFPath"];
        string fullPath = string.Empty;
        string message = CreatePath(basePath, month, year, out fullPath);
        if(message.Trim()=="")
        {
            List<FundMaster> lstFundMaster = commonRepo.GetFundMaster();
            foreach(FundMaster fund in lstFundMaster)
            {
                return RedirectToAction("PDFFactSheetData", "FactSheet", new { fundCode = fund.FundCode, filePath = fullPath });
            }
        }
        return Json(message, JsonRequestBehavior.AllowGet);
    }
public ActionResult PDFFactSheetData(string fundCode="BAL",string filePath="")
    {
        FactSheet factSheetData = new FactSheet();
        factSheetData = factsheetRepo.GetFactSheetData(fundCode);
        FundInvestmentStyle investmentStyle = factSheetData.InvestmentStyle;           
        string pdfFileName = fundCode + ".pdf";
        string fullFilePath = Path.Combine(filePath, pdfFileName);
        return new ViewAsPdf(templateName, factSheetData) { FileName = pdfFileName, PageSize = Rotativa.Options.Size.A4, SaveOnServerPath = fullFilePath };

    }