public override void ProcessRequest(HttpContext context) { base.ProcessRequest(context); int ShowID = Convert.ToInt32(context.Request["showid"]); Shows show = new Shows(ShowID); var writer = PdfWriter.GetInstance(doc, output); var pageEvent = new Fpp.Core.PdfDocuments.ITextEvents(); pageEvent.Header = "Refund Report"; pageEvent.SubHeader = string.Format("{0} {1}", show.ShowName, show.ShowDate.ToString("dd MMM yyyy")); writer.PageEvent = pageEvent; StyleSheet sheet = new StyleSheet(); doc.Open(); PdfPCell cell; PdfPTable ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Show Reference", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Date", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Name", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Description", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); doc.Add(ptable); ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Amount", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); doc.Add(ptable); var refunds = Transaction.GetShowRefunds(ShowID); PrintReport(ShowID, refunds, doc); doc.NewPage(); doc.Close(); context.Response.ClearContent(); context.Response.ContentType = "application/pdf"; context.Response.AddHeader("content-disposition", String.Format("inline;filename=Refund-{0:ddMMMyyyy}.pdf", show.ShowDate)); context.Response.BinaryWrite((output as MemoryStream).ToArray()); }
public override void ProcessRequest(HttpContext context) { int ShowID = Convert.ToInt32(context.Request["showid"]); Shows show = new Shows(ShowID); DateTime fromDate, toDate; if (string.IsNullOrEmpty( context.Request["FromDate"])) { fromDate = DateTime.MinValue; } else { fromDate = DateTime.Parse(context.Request["FromDate"].ToString()); } if (string.IsNullOrEmpty( context.Request["ToDate"] )) { toDate = DateTime.MaxValue; } else { toDate = DateTime.Parse(context.Request["ToDate"].ToString()); } doc = new Document(PageSize.A4, -10, -50, 100, 50); Stream output = new MemoryStream(); var writer = PdfWriter.GetInstance(doc, output); var pageEvent = new Fpp.Core.PdfDocuments.ITextEvents( ); pageEvent.Header = "Cheque Payments"; pageEvent.SubHeader = string.Format("{0} Show Date:{1}", show.ShowName, show.ShowDate.ToString("dd MMM yyyy")); writer.PageEvent = pageEvent; doc.Open(); ptable = new PdfPTable(headerWidths); var masterList = Transaction.getOfflineList(ShowID, fromDate, toDate); PrintReport("Cheque", masterList.Where(x => x.Cheque != 0 && x.Comment.Contains("Cheque")).ToList()); PrintReport("BACS", masterList.Where(x => x.Cheque != 0 && x.Comment.Contains("BACS")).ToList()); PrintReport("Voucher", masterList.Where(x => x.Cheque != 0 && x.Comment.Contains("Voucher")).ToList()); PrintReport("Cash", masterList.Where(x => x.Cheque != 0 && x.Comment.Contains("Cash")).ToList()); doc.Close(); context.Response.ClearContent(); context.Response.ContentType = "application/pdf"; context.Response.AddHeader("content-disposition", String.Format("inline;filename=ChequeList-{0:ddMMMyyyy}.pdf", show.ShowDate)); context.Response.BinaryWrite((output as MemoryStream).ToArray()); }
public void ProcessRequest(HttpContext context) { int ShowID = Convert.ToInt32(context.Request["showid"]); Shows show = new Shows(ShowID); Document doc = new Document(PageSize.A4, -10, -50, 100, 50); Stream output = new MemoryStream(); var writer = PdfWriter.GetInstance(doc, output); var pageEvent = new Fpp.Core.PdfDocuments.ITextEvents(); pageEvent.Header = "Money Report"; pageEvent.SubHeader = string.Format("{0} {1}", show.ShowName, show.ShowDate.ToString("dd MMM yyyy")); writer.PageEvent = pageEvent; StyleSheet sheet = new StyleSheet(); doc.Open(); float [] headerWidths = { 200, 300, 150 }; PdfPTable ptable = new PdfPTable(headerWidths); PdfPCell cell; cell = new PdfPCell(new Phrase(new Chunk("Money Outstanding", bigFont))); cell.HorizontalAlignment = Element.ALIGN_LEFT; cell.BorderWidth = 0; cell.FixedHeight = 100; ptable.AddCell(cell); cell = new PdfPCell(new Phrase(new Chunk(show.ShowName, bigFont))); cell.HorizontalAlignment = Element.ALIGN_CENTER; cell.BorderWidth = 0; ptable.AddCell(cell); cell = new PdfPCell(new Phrase(new Chunk(show.ShowDate.ToString("dd MMM yyyy"), bigFont))); cell.BorderWidth = 0; cell.HorizontalAlignment = Element.ALIGN_RIGHT; ptable.AddCell(cell); doc.Add(ptable); float[] colWidths = { 100, 140, 200}; ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Show Reference", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Name", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Amount", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); doc.Add(ptable); List<UserShows> userShowsList = UserShows.getAllPaidUsersForShow(ShowID); PrintReport(ShowID, userShowsList, doc, true, true); doc.NewPage(); cell = new PdfPCell(new Phrase(new Chunk("Overpayments", bigFont))); cell.HorizontalAlignment = Element.ALIGN_LEFT; cell.BorderWidth = 0; cell.FixedHeight = 100; ptable.AddCell(cell); cell = new PdfPCell(new Phrase(new Chunk(show.ShowName, bigFont))); cell.HorizontalAlignment = Element.ALIGN_CENTER; cell.BorderWidth = 0; ptable.AddCell(cell); cell = new PdfPCell(new Phrase(new Chunk(show.ShowDate.ToString("dd MMM yyyy"), bigFont))); cell.BorderWidth = 0; cell.HorizontalAlignment = Element.ALIGN_RIGHT; ptable.AddCell(cell); doc.Add(ptable); ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Show Reference", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Name", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); ptable = new PdfPTable(colWidths); cell = new PdfPCell(new Phrase(new Chunk("Amount", headerFont))); cell.BorderWidth = 0; ptable.AddCell(cell); doc.Add(ptable); PrintReport(ShowID, userShowsList, doc, false, false); doc.NewPage(); doc.Close(); context.Response.ClearContent(); context.Response.ContentType = "application/pdf"; context.Response.AddHeader("content-disposition", String.Format("inline;filename=OutstandingPayments-{0:ddMMMyyyy}.pdf", show.ShowDate)); context.Response.BinaryWrite((output as MemoryStream).ToArray()); }
public override void ProcessRequest(HttpContext context) { int ShowID = Convert.ToInt32(context.Request["showid"]); Shows show = new Shows(ShowID); DateTime fromDate, toDate; if (string.IsNullOrEmpty(context.Request["FromDate"])) { fromDate = DateTime.MinValue; } else { fromDate = DateTime.Parse(context.Request["FromDate"].ToString()); } if (string.IsNullOrEmpty(context.Request["ToDate"])) { toDate = DateTime.MaxValue; } else { toDate = DateTime.Parse(context.Request["ToDate"].ToString()).AddDays(1).AddMinutes(-1); } doc = new Document(PageSize.A4, -10, -50, 100, 50); Stream output = new MemoryStream(); var writer = PdfWriter.GetInstance(doc, output); var pageEvent = new Fpp.Core.PdfDocuments.ITextEvents(); pageEvent.Header = "Online Payments"; pageEvent.SubHeader = string.Format("{0} {1}", show.ShowName, show.ShowDate.ToString("dd MMM yyyy")); writer.PageEvent = pageEvent; StyleSheet sheet = new StyleSheet(); doc.Open(); ptable = new PdfPTable(headerWidths); var masterList = Transaction.getOnlineUserTransactions(ShowID) .Where(x => x.TransactionDate >= fromDate && x.TransactionDate <= toDate).OrderByDescending(x => x.TransactionDate).ToList(); //PrintReport("", masterList); var fixedFees = ShowDiscounts.getDiscountsByType(ShowID, -1, (int)DiscountTypes.TransactionCharge).Sum(x => x.Amount); PrintReport("Club Transaction List", masterList .Where(x => x.TransactionType == TransactionTypes.ShowEntryPayment && Regex.IsMatch(x.Comment, @"^\d+$") && x.Amount > 0) .OrderByDescending( x=> x.TransactionDate) .ToList(), fixedFees, true); doc.Close(); context.Response.ClearContent(); context.Response.ContentType = "application/pdf"; context.Response.AddHeader("content-disposition", String.Format("inline;filename=ClubTransactions-{0:ddMMMyyyy}.pdf", show.ShowDate)); context.Response.BinaryWrite((output as MemoryStream).ToArray()); }