Asp.net mvc Rotativa多重PDF生成
我正在使用rotativa生成PDF。我想根据下面列表中的记录数生成多个PDF。代码仅生成一个PDFAsp.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 =
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 };
}