private void PrintStockControl(int printType) { strBody = ""; StringPrintFormater stringPrintFormater = new StringPrintFormater(40); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Carnival Restaruant"); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Road # 35; House # 1; Gulshan # 2"); if (printType == 1) { strBody += "\r\n\n" + stringPrintFormater.CenterTextWithWhiteSpace("STOCK REPORT"); } else if(printType == 2) { strBody += "\r\n\n" + stringPrintFormater.CenterTextWithWhiteSpace("Reorder Level OF STOCK REPORT"); } else if (printType == 2) { strBody += "\r\n\n" + stringPrintFormater.CenterTextWithWhiteSpace("OUT OF STOCK REPORT"); } strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace(DateTime.Now.ToLongDateString()); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.GridCell("Item Name", 20, false); strBody += stringPrintFormater.GridCell("Qty", 5, true); strBody += stringPrintFormater.GridCell("Unit", 15, true); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); double balanceQnty = 0; double currentQnty = 0; string itemName = ""; foreach (DataGridViewRow row in dgvFoodItem.Rows) { // string[] _Item = row.Cells["Category3_Name"].Value.ToString().Split('.'); // string Item = _Item[0]; // string[] _Current_Stock = row.Cells["UnitsInStock"].Value.ToString().Split('.'); // string Current_Stock = _Current_Stock[0]; //// string[] _Balance_Unit = row.Cells["Balance_Unit"].Value.ToString().Split('.'); // string Balance_Unit = _Balance_Unit[0]; try { currentQnty = Convert.ToDouble(row.Cells["UnitsInStock"].Value.ToString()); } catch(Exception ) { currentQnty = 0; } string uom="Kg"; balanceQnty += currentQnty; strBody += "\r\n" + stringPrintFormater.GridCell(row.Cells["Category3_Name"].Value.ToString(), 20, false); strBody += stringPrintFormater.GridCell(currentQnty.ToString(), 5, true); strBody += stringPrintFormater.GridCell(balanceQnty.ToString(), 15, true); // strBody += stringPrintFormater.GridCell(row.Cells["uom"].Value.ToString(), 15, true); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); } strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("End Report"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("ibacs.co.uk"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); if (printDialog1.ShowDialog() == DialogResult.OK) { Margins margins = new Margins(10, 10, 10, 10); printDocument1.DefaultPageSettings.Margins = margins; printDocument1.Print(); } }
private string PrintReport() { string strBody = ""; StringPrintFormater stringPrintFormater = new StringPrintFormater(172); string header = GetPrintDecorationText(PrintDecoration.HEADER); string[] lines = null; char[] param = { '\n' }; if (header != null && header.Length > 0) lines = header.Split(param); int i = 0; char[] trimParam = { '\r' }; string TotalHader = ""; if (lines != null && lines.Length > 0) foreach (string s in lines) { TotalHader += stringPrintFormater.CenterTextWithWhiteSpace(s.TrimEnd(trimParam)) + "\r\n"; } strBody += TotalHader; strBody += "\r\n"; strBody += stringPrintFormater.CreateDashedLine(); strBody += "\r\n"+stringPrintFormater.GridCell("Booking Date", 15, false); strBody += stringPrintFormater.GridCell("Creator", 20, false); strBody += stringPrintFormater.GridCell("Party Date", 15, false); strBody += stringPrintFormater.GridCell("Guest", 10, false); strBody += stringPrintFormater.GridCell("P. Amount", 15, false); strBody += stringPrintFormater.GridCell("D. Amount", 15, false); strBody += stringPrintFormater.GridCell("Due Amount", 15, false); strBody += stringPrintFormater.GridCell("S. Charge", 15, false); strBody += stringPrintFormater.GridCell("Vat", 15, false); strBody += stringPrintFormater.GridCell("Discount", 15, false); strBody += stringPrintFormater.GridCell("Client Name", 15, false); strBody += "\r\n"+ stringPrintFormater.CreateDashedLine(); // strBody += "\r\n"; int count = 0; int length = reportdataGridView.Rows.Count; foreach (DataGridViewRow row in reportdataGridView.Rows) { count++; if (count != length) { try { strBody += "\r\n"; try { strBody += stringPrintFormater.GridCell(Convert.ToDateTime(row.Cells["BookingDate"].Value).ToShortDateString(), 15, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["Creator"].Value.ToString(), 20, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(Convert.ToDateTime(row.Cells["partydate"].Value).ToShortDateString(), 15, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["Total Guest"].Value.ToString(), 10, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["totalpayableamount"].Value.ToString(), 15, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["depositeamount"].Value.ToString(), 15, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["dueamount"].Value.ToString(), 15, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["servicecharge"].Value.ToString(), 15, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["vat"].Value.ToString(), 15, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["discount"].Value.ToString(), 15, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["clientname"].Value.ToString(), 15, false); } catch (Exception) { } } catch (Exception) { } } strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); } strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithDashed("END REPORT"); strBody += "\r\n\r\n\r\n" + " ------------------------" + " --------------------- "; strBody += "\r\n" + " Signature Executive Chef" + " Signature Managemant "; return strBody; }
private string PrintReport(List<CSearchOrderInfo> oItemList) { string strBody = ""; stringPrintFormater = new StringPrintFormater(172); string header = GetPrintDecorationText(PrintDecoration.HEADER); printReportLogoType = 1; string[] lines = null; char[] param = { '\n' }; if (header != null && header.Length > 0) lines = header.Split(param); int i = 0; char[] trimParam = { '\r' }; string TotalHader = ""; if (lines != null && lines.Length > 0) foreach (string s in lines) { TotalHader += stringPrintFormater.CenterTextWithWhiteSpace(s.TrimEnd(trimParam)) + "\r\n"; } strBody += TotalHader; // strBody += "\r\n"; strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("SALES REPORT"); // strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("RED CHICK'N"); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Date: From - " + dtpStart.Value.Date.ToShortDateString() + " to " + dtpEnd.Value.Date.ToShortDateString()); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Total Guest: " + lelGuest_Value.Text, "Food Price: " + lelFoodPrice_Value.Text); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Take Away Food Price: " + lelTakeAwayFoodPrice_Value.Text, "Non Food Price: " + lelNonfoodPrice_Value.Text); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Take Away Non Food Price: " + lelTakeAwayNonfoodPrice_Value.Text, "Total: " + lelOrderTotal_Value.Text); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Table Food Price: " + lelTableFoodPrice_Value.Text, "Vat Total: " + lelVat_Value.Text); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Table Non Food Price: " + lelTableNonfoodPrice_Value.Text, "Service Charge: " + lelServiceCharge_Value.Text); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("", "Discount: " + lelDiscount_Value.Text); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("", "Total Paid (IncVat): " + lelTotalpaidIncVAT_value.Text); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("", "Cash: " + lelCashTotal_value.Text); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("", "EFT: " + lelEftTotal_value.Text); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("", "Due: " + dueTotalLabel.Text); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("", "Complementory: " + complementorylabel.Text); //change by mithu double cost = (from item in oItemList select item.TotalCost).Sum(); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("", "Total Cost: " + cost.ToString("F02")); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("", "Total Profit: " + profitlebel.Text); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n"; strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("DETAILS"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.GridCell("O/ID", 9, false); // strBody += stringPrintFormater.GridCell("SN", 14, false); strBody += stringPrintFormater.GridCell("Order Date-Time", 25, false); strBody += stringPrintFormater.GridCell("O/Type", 10, false); strBody += stringPrintFormater.GridCell("Cover", 7, false); // strBody += stringPrintFormater.GridCell("Food Total", 12, true); // strBody += stringPrintFormater.GridCell("NonF Total", 12, true); strBody += stringPrintFormater.GridCell("Order Total", 12, true); strBody += stringPrintFormater.GridCell("Discount", 10, true); strBody += stringPrintFormater.GridCell("Ser.Charge", 12, true); // strBody += stringPrintFormater.GridCell("ExV Total", 12, true); strBody += stringPrintFormater.GridCell("IncV Total", 12, true); strBody += stringPrintFormater.GridCell("Vat Total", 10, true); strBody += stringPrintFormater.GridCell("Cash", 12, true); strBody += stringPrintFormater.GridCell("EFT", 12, true); strBody += stringPrintFormater.GridCell("EFT Card", 16, false); strBody += stringPrintFormater.GridCell("Due", 10, false); strBody += stringPrintFormater.GridCell("Cost", 10, false); strBody += stringPrintFormater.GridCell("Waiter", 20, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); foreach (CSearchOrderInfo item in oItemList) { strBody += "\r\n" + stringPrintFormater.GridCell(item.OrderID.ToString(), 9, false); // strBody += stringPrintFormater.GridCell(item.SerialNumber.ToString(), 14, false); strBody += stringPrintFormater.GridCell(item.OrderDateTime.ToString(), 25, false); strBody += stringPrintFormater.GridCell(item.OrderType.ToString(), 10, false); strBody += stringPrintFormater.GridCell(item.Covers.ToString(), 7, false); // strBody += stringPrintFormater.GridCell(item.FoodTotal.ToString(), 12, true); // strBody += stringPrintFormater.GridCell(item.NonfoodTotal.ToString(), 12, true); strBody += stringPrintFormater.GridCell(item.OrderTotal.ToString(), 12, true); strBody += stringPrintFormater.GridCell(item.Discount.ToString(), 10, true); strBody += stringPrintFormater.GridCell(item.ServiceChargeCash.ToString(), 12, true); // strBody += stringPrintFormater.GridCell(item.TotalPaidExcludingVat.ToString(), 12, true); strBody += stringPrintFormater.GridCell(item.TotalPaidIncludingVat.ToString(), 12, true); strBody += stringPrintFormater.GridCell(item.VatPaid.ToString(), 10, true); strBody += stringPrintFormater.GridCell(item.CashPaid.ToString(), 12, true); strBody += stringPrintFormater.GridCell(item.EFTPaid.ToString(), 12, true); strBody += stringPrintFormater.GridCell(item.EFTCardName.ToString(), 16, false); strBody += stringPrintFormater.GridCell(item.DuePaid.ToString(), 10, false); strBody += stringPrintFormater.GridCell(item.TotalCost.ToString("F02"), 10, false); strBody += stringPrintFormater.GridCell(item.Waiter, 20, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); } // strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithDashed("END REPORT"); strBody += "\r\n\r\n\r\n" + " --------------------" + " --------------------- "; strBody += "\r\n" + " Checked By" + " Prepared By "; return strBody; }
private string PrintReportForPOS() { List<ReservationIteminformation> utilityIteminformations = new List<ReservationIteminformation>(); utilityIteminformations = aPartyReservationDao.GetUtilityIteminformationByreservationId(reservationId); List<ReservationIteminformation> otherGuestIteminformations = new List<ReservationIteminformation>(); otherGuestIteminformations = aPartyReservationDao.GetotherguestIteminformationByreservationId(reservationId); List<ReservationIteminformation> mainGuestIteminformations = new List<ReservationIteminformation>(); mainGuestIteminformations = aPartyReservationDao.GetMainguestIteminformationByreservationId(reservationId); string strBody = ""; StringPrintFormater stringPrintFormater = new StringPrintFormater(40); string header = GetPrintDecorationText(PrintDecoration.HEADER); string[] lines = null; char[] param = { '\n' }; if (header != null && header.Length > 0) lines = header.Split(param); int i = 0; char[] trimParam = { '\r' }; string TotalHader = ""; if (lines != null && lines.Length > 0) foreach (string s in lines) { TotalHader += stringPrintFormater.CenterTextWithWhiteSpace(s.TrimEnd(trimParam)) + "\r\n"; } strBody += TotalHader; // strBody += "\r\n"; strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Party Reservation Form"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Booking Date: " + PartyReservation.BookingDate.ToShortDateString(),""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Booking By: " + PartyReservation.LoginPerson, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Booking Area: " + PartyReservation.BookingArea, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Type Of Booking: " + PartyReservation.BookingType,""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Party Date: " + PartyReservation.PartyDate.ToShortDateString(), ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Nummber Of Guest: " + PartyReservation.NumberOfGuest,""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Time Of Entry: " + PartyReservation.FromTime + " To " + PartyReservation.ToTime, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Number Of Other Guest: " + PartyReservation.NumberofOtherGuest,""); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace(" Main Guest Particulars"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.GridCell("Item Name", 18, false); // strBody += stringPrintFormater.GridCell("SN", 14, false); strBody += stringPrintFormater.GridCell("Unit Price", 12, false); strBody += stringPrintFormater.GridCell("Total Price",10, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); foreach (ReservationIteminformation iteminformation in mainGuestIteminformations) { strBody += "\r\n" + stringPrintFormater.GridCell(iteminformation.ItemName,18, false); // strBody += stringPrintFormater.GridCell(item.SerialNumber.ToString(), 14, false); strBody += stringPrintFormater.GridCell(iteminformation.UnitPrice.ToString("F02"),12, false); strBody += stringPrintFormater.GridCell(iteminformation.TotalPrice.ToString("F02"), 10, false); } strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Other Guest Particulars"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.GridCell("Item Name", 18, false); // strBody += stringPrintFormater.GridCell("SN", 14, false); strBody += stringPrintFormater.GridCell("Unit Price", 12, false); strBody += stringPrintFormater.GridCell("Total Price", 10, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); foreach (ReservationIteminformation iteminformation in otherGuestIteminformations) { strBody += "\r\n" + stringPrintFormater.GridCell(iteminformation.ItemName, 18, false); // strBody += stringPrintFormater.GridCell(item.SerialNumber.ToString(), 14, false); strBody += stringPrintFormater.GridCell(iteminformation.UnitPrice.ToString("F02"), 12, false); strBody += stringPrintFormater.GridCell(iteminformation.TotalPrice.ToString("F02"), 10, false); } strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Utility Cost Particulars"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.GridCell("Item Name", 26, false); // strBody += stringPrintFormater.GridCell("SN", 14, false); //strBody += stringPrintFormater.GridCell("Unit Price", 40, false); strBody += stringPrintFormater.GridCell("Total Price", 10, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); foreach (ReservationIteminformation iteminformation in utilityIteminformations) { strBody += "\r\n" + stringPrintFormater.GridCell(iteminformation.ItemName, 26, false); // strBody += stringPrintFormater.GridCell(item.SerialNumber.ToString(), 14, false); //strBody += stringPrintFormater.GridCell(iteminformation.UnitPrice.ToString("F02"), 40, false); strBody += stringPrintFormater.GridCell(iteminformation.TotalPrice.ToString("F02"), 10, false); } strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" +stringPrintFormater.ItemLabeledText( "Main Guest Amount(Tk): " + PartyReservation.MainGuestAmount.ToString("F02"), ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Total Payable Amount(Tk): " + PartyReservation.TotalPayableAmount.ToString("F02"),""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Other Guest Amount(Tk): " + PartyReservation.OtherGuestAmount.ToString("F02"), ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Deposite Amount(Tk): " + PartyReservation.DepositeAmount.ToString("F02"),""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Utility Cost Amount(Tk): " + PartyReservation.UtilityCostAmount.ToString("F02"), ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Due Amount(Tk): " + PartyReservation.DueAmount.ToString("F02"), ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Service Charge Amount(Tk): " + PartyReservation.ServiceCharge.ToString("F02"), ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Vat Amount(Tk): " + PartyReservation.Vat.ToString("F02"), ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Discount Amount(Tk): " + PartyReservation.Discount.ToString("F02"), ""); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Special Instruction"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + PartyReservation.SpecialInstruction; strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Client Information"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Full Name: " + PartyReservation.ClientName, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Cell Number: " + PartyReservation.ClientPhone, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Email Address: " + PartyReservation.ClientEmail, ""); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithDashed("END REPORT"); strBody += "\r\n\r\n\r\n" + "--------------------" + " --------------------- "; strBody += "\r\n" + "Executive Chef" + " Managemant "; PartyReservation.PrintPreview = strBody; return strBody; }
private string PrintReport(List<DatewiseTotal> datewiseTotals) { string strBody = ""; StringPrintFormater stringPrintFormater = new StringPrintFormater(172); ViewReport aReport = new ViewReport(); string header = aReport.GetPrintDecorationText(PrintDecoration.HEADER); printReportLogoType = 1; string[] lines = null; char[] param = { '\n' }; if (header != null && header.Length > 0) lines = header.Split(param); int i = 0; char[] trimParam = { '\r' }; string TotalHader = ""; if (lines != null && lines.Length > 0) foreach (string s in lines) { TotalHader += stringPrintFormater.CenterTextWithWhiteSpace(s.TrimEnd(trimParam)) + "\r\n"; } strBody += TotalHader; // strBody += "\r\n"; strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Total Monthly Report"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); double total = (from Total in datewiseTotals select Total.TotalIncV).Sum(); double totalvat = (from tvat in datewiseTotals select tvat.VatTotal).Sum(); strBody += "\r\n" + stringPrintFormater.ItemLabeledText( "Total Paid (IncVat): " + total.ToString("F02"),""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Total Vat: "+totalvat.ToString("F02"),""); // strBody += "\r\n" + stringPrintFormater.ItemLabeledText("", "Total Cost: " + cost.ToString("F02")); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.GridCell("Date", 25, false); strBody += stringPrintFormater.GridCell("Order Total", 14, false); strBody += stringPrintFormater.GridCell("Cash", 12, false); strBody += stringPrintFormater.GridCell("Card", 12, false); strBody += stringPrintFormater.GridCell("Due", 12, false); strBody += stringPrintFormater.GridCell("Vat", 12, false); strBody += stringPrintFormater.GridCell("Food Total", 12, false); strBody += stringPrintFormater.GridCell("NonF Total", 12, false); strBody += stringPrintFormater.GridCell("Ser.Charge", 12, false); strBody += stringPrintFormater.GridCell("Discount", 12, false); // strBody += stringPrintFormater.GridCell("ExV Total", 12, true); strBody += stringPrintFormater.GridCell("IncV Total", 12, false); strBody += stringPrintFormater.GridCell("Covers", 12, false); //strBody += stringPrintFormater.GridCell("Cash", 12, true); //strBody += stringPrintFormater.GridCell("EFT", 12, true); //strBody += stringPrintFormater.GridCell("EFT Card", 16, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); foreach (DatewiseTotal item in datewiseTotals) { strBody += "\r\n" + stringPrintFormater.GridCell(item.Date.ToString(), 25, false); // strBody += stringPrintFormater.GridCell(item.SerialNumber.ToString(), 14, false); strBody += stringPrintFormater.GridCell(item.OrderTotal.ToString("F02"), 14, false); strBody += stringPrintFormater.GridCell(item.CashTotal.ToString("F02"), 12, false); strBody += stringPrintFormater.GridCell(item.EFTTotal.ToString("F02"), 12, false); strBody += stringPrintFormater.GridCell(item.DueTotal.ToString("F02"), 12, false); strBody += stringPrintFormater.GridCell(item.VatTotal.ToString("F02"), 12, false); strBody += stringPrintFormater.GridCell(item.FoodTotal.ToString("F02"), 12, false); strBody += stringPrintFormater.GridCell(item.NoonFoodTotal.ToString("F02"), 12, false); strBody += stringPrintFormater.GridCell(item.ServiceChargeTotal.ToString("F02"), 12, false); strBody += stringPrintFormater.GridCell(item.DiscountTotal.ToString("F02"), 12, false); strBody += stringPrintFormater.GridCell(item.TotalIncV.ToString("F02"), 12, false); strBody += stringPrintFormater.GridCell(item.Covers.ToString(), 12, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); // Change by Mithu ( Date to Date Seperate will be) // strBody += stringPrintFormater.GridCell(item.OrderTotal.ToString(), 12, true); // strBody += stringPrintFormater.GridCell(item.TotalPaidExcludingVat.ToString(), 12, true); //strBody += stringPrintFormater.GridCell(item.CashPaid.ToString(), 12, true); //strBody += stringPrintFormater.GridCell(item.EFTCardName.ToString(), 16, false); //strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); } // strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithDashed("END REPORT"); strBody += "\r\n\r\n\r\n" + " --------------------" + " --------------------- "; strBody += "\r\n" + " Checked By" + " Prepared By "; return strBody; }
private string PrintReport(DataTable dtFood) { StringPrintFormater stringPrintFormater = new StringPrintFormater(172); string strBody = ""; string header = GetPrintDecorationText(PrintDecoration.HEADER); string[] lines = null; char[] param = { '\n' }; if (header != null && header.Length > 0) lines = header.Split(param); int i = 0; char[] trimParam = { '\r' }; string TotalHader = ""; if (lines != null && lines.Length > 0) foreach (string s in lines) { TotalHader += stringPrintFormater.CenterTextWithWhiteSpace(s.TrimEnd(trimParam)) + "\r\n"; } strBody += TotalHader; // strBody += "\r\n"; strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("SALES REPORT- Category WISE"); // strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("RED CHICK'N"); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Date: From - " + dtpStart.Value.ToShortDateString() + " to " + dtpEnd.Value.ToShortDateString()); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); Decimal totalprice = 0; try { totalprice = (from order in dtFood.AsEnumerable() select order.Field<Decimal>("TotalPrice")).Sum(); } catch (Exception) { } strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Total Sold Price: "+totalprice.ToString("F02"),"" ); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblQtySoldFood.Text, ""); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblQtySoldNonFood.Text, ""); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblQtySoldTotal.Text, ""); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblPriceFood.Text, ""); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblPriceNonFood.Text, ""); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblPriceTotal.Text, ""); //strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); //strBody += "\r\n"; //strBody += "\r\n"; //strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("DETAILS : FOOD"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); // strBody += "\r\n" + stringPrintFormater.GridCell("Item ID", 15, false); strBody += "\r\n" + stringPrintFormater.GridCell("Item Name", 45, false); strBody += stringPrintFormater.GridCell("Price Per Unit", 18, false); strBody += stringPrintFormater.GridCell("Quantity Sold", 18, false); strBody += stringPrintFormater.GridCell("Total Price", 18, false); //strBody += stringPrintFormater.GridCell("Total Cost", 18, false); //strBody += stringPrintFormater.GridCell("Profit", 18, false); //strBody += stringPrintFormater.GridCell("Profit(%)", 18, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); foreach (DataRow row in dtFood.Rows) { //strBody += "\r\n" + stringPrintFormater.GridCell(row[0].ToString(), 15, false); strBody += "\r\n" + stringPrintFormater.GridCell(row["product_Name"].ToString(), 45, false); strBody += stringPrintFormater.GridCell(row["PricePerUnit"].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row["QuantitySold"].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row["TotalPrice"].ToString(), 18, false); //strBody += stringPrintFormater.GridCell(row[5].ToString(), 18, false); //strBody += stringPrintFormater.GridCell(row[6].ToString(), 18, false); //strBody += stringPrintFormater.GridCell(row[7].ToString(), 18, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); } //strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); //strBody += "\r\n"; //strBody += "\r\n"; //strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("DETAILS : NON FOOD"); //strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); //foreach (DataRow row in dtNonFood.Rows) //{ // strBody += "\r\n" + stringPrintFormater.GridCell(row[0].ToString(), 15, false); // strBody += stringPrintFormater.GridCell(row[1].ToString(), 45, false); // strBody += stringPrintFormater.GridCell(row[2].ToString(), 18, false); // strBody += stringPrintFormater.GridCell(row[3].ToString(), 18, false); // strBody += stringPrintFormater.GridCell(row[4].ToString(), 18, false); // strBody += stringPrintFormater.GridCell(row[5].ToString(), 18, false); // strBody += stringPrintFormater.GridCell(row[6].ToString(), 18, false); // strBody += stringPrintFormater.GridCell(row[7].ToString(), 18, false); // strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); //} // strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithDashed("END REPORT"); strBody += "\r\n\r\n\r\n" + " --------------------" + " --------------------- "; strBody += "\r\n" + " Checked By" + " Prepared By "; return strBody; }
private string PrintReportPreparedForDateTodate(List<double> doubles) { string strBody = ""; StringPrintFormater stringPrintFormater = new StringPrintFormater(172); string header = GetPrintDecorationText(PrintDecoration.HEADER); string[] lines = null; char[] param = { '\n' }; if (header != null && header.Length > 0) lines = header.Split(param); int i = 0; char[] trimParam = { '\r' }; string TotalHader = ""; if (lines != null && lines.Length > 0) foreach (string s in lines) { TotalHader += stringPrintFormater.CenterTextWithWhiteSpace(s.TrimEnd(trimParam)) + "\r\n"; } strBody += TotalHader; strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Cash In: "+label4.Text,""); strBody += "\r\n"; strBody += stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.GridCell("Transaction Date", 15+5, false); strBody += stringPrintFormater.GridCell("Credit Amount", 15+ 3, false); strBody += stringPrintFormater.GridCell("DebitAmount", 15 + 3, false); strBody += stringPrintFormater.GridCell("Other DEBIT", 10 + 5, false); strBody += stringPrintFormater.GridCell("Balance", 15 + 3, false); strBody += stringPrintFormater.GridCell("Cash Amount", 15 + 3, false); strBody += stringPrintFormater.GridCell("Cash Balance", 15 + 3, false); strBody += stringPrintFormater.GridCell("Cash In", 15 + 3, false); strBody += stringPrintFormater.GridCell("Cash Out", 15 + 3, false); strBody += stringPrintFormater.GridCell("Cash Extra", 15 + 3, false); //strBody += stringPrintFormater.GridCell("S. Charge", 15, false); //strBody += stringPrintFormater.GridCell("Vat", 15, false); //strBody += stringPrintFormater.GridCell("Discount", 15, false); //strBody += stringPrintFormater.GridCell("Client Name", 15, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); // strBody += "\r\n"; int count = 0; int length = balancedataGridView.Rows.Count; //Transaction_Date, Credit_Amount,Debit_Amount,Other_DEBIT,Balance,Cash_Amount,Cash_Balance foreach (DataGridViewRow row in balancedataGridView.Rows) { count++; try { strBody += "\r\n"; try { strBody += stringPrintFormater.GridCell(Convert.ToDateTime(row.Cells["TransactionDate"].Value).ToShortDateString(), 15 + 5, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["CreditAmount"].Value.ToString(), 15 + 3, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell((row.Cells["DebitAmount"].Value).ToString(), 15 + 3, false); } catch (Exception) { } // Balance,Cash_Amount,Cash_Balance try { strBody += stringPrintFormater.GridCell(row.Cells["OtherDebitAmount"].Value.ToString(), 10 + 5, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["Balance"].Value.ToString(), 15 + 3, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["CashAmount"].Value.ToString(), 15 + 3, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["CashBalance"].Value.ToString(), 15 + 3, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["CashIn"].Value.ToString(), 15 + 3, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["CashOut"].Value.ToString(), 15 + 3, false); } catch (Exception) { } try { strBody += stringPrintFormater.GridCell(row.Cells["CashExtra"].Value.ToString(), 15 + 3, false); } catch (Exception) { } //try //{ // strBody += stringPrintFormater.GridCell(row.Cells["servicecharge"].Value.ToString(), 15, false); //} //catch (Exception) //{ //} //try //{ // strBody += stringPrintFormater.GridCell(row.Cells["vat"].Value.ToString(), 15, false); //} //catch (Exception) //{ //} //try //{ // strBody += stringPrintFormater.GridCell(row.Cells["discount"].Value.ToString(), 15, false); //} //catch (Exception) //{ //} //try //{ // strBody += stringPrintFormater.GridCell(row.Cells["clientname"].Value.ToString(), 15, false); //} //catch (Exception) //{ //} } catch (Exception) { } strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); } strBody += "\r\n" + stringPrintFormater.CenterTextWithDashed("END REPORT"); strBody += "\r\n\r\n\r\n" + " --------------------" + " --------------------- "; strBody += "\r\n" + " Checked By" + " Prepared By "; return strBody; }
private string PrintReport(DataTable dtFood, DataTable dtNonFood) { stringPrintFormater = new StringPrintFormater(172); string strBody = ""; string header = GetPrintDecorationText(PrintDecoration.HEADER); string[] lines = null; char[] param = { '\n' }; if (header != null && header.Length > 0) lines = header.Split(param); int i = 0; char[] trimParam = { '\r' }; string TotalHader = ""; if (lines != null && lines.Length > 0) foreach (string s in lines) { TotalHader += stringPrintFormater.CenterTextWithWhiteSpace(s.TrimEnd(trimParam)) + "\r\n"; } strBody += TotalHader; // strBody += "\r\n"; strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("SALES REPORT- ITEM WISE"); // strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("RED CHICK'N"); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Date: From - " + fromDate.ToShortDateString() + " to " + toDate.ToShortDateString()); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblOrderCount.Text, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblQtySoldFood.Text, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblQtySoldNonFood.Text, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblQtySoldTotal.Text, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblPriceFood.Text, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblPriceNonFood.Text, ""); strBody += "\r\n" + stringPrintFormater.ItemLabeledText("" + lblPriceTotal.Text, ""); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n"; strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("DETAILS : FOOD"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.GridCell("Item ID", 15, false); strBody += stringPrintFormater.GridCell("Item Name", 45, false); strBody += stringPrintFormater.GridCell("Price Per Unit", 18, false); strBody += stringPrintFormater.GridCell("Quantity Sold", 18, false); strBody += stringPrintFormater.GridCell("Total Price", 18, false); strBody += stringPrintFormater.GridCell("Total Cost", 18, false); strBody += stringPrintFormater.GridCell("Profit", 18, false); strBody += stringPrintFormater.GridCell("Profit(%)", 18, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); foreach (DataRow row in dtFood.Rows) { strBody += "\r\n" + stringPrintFormater.GridCell(row[0].ToString(), 15, false); strBody += stringPrintFormater.GridCell(row[1].ToString(), 45, false); strBody += stringPrintFormater.GridCell(row[2].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row[3].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row[4].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row[5].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row[6].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row[7].ToString(), 18, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); } strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n"; strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("DETAILS : NON FOOD"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); foreach (DataRow row in dtNonFood.Rows) { strBody += "\r\n" + stringPrintFormater.GridCell(row[0].ToString(), 15, false); strBody += stringPrintFormater.GridCell(row[1].ToString(), 45, false); strBody += stringPrintFormater.GridCell(row[2].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row[3].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row[4].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row[5].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row[6].ToString(), 18, false); strBody += stringPrintFormater.GridCell(row[7].ToString(), 18, false); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); } // strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n"; strBody += "\r\n" + stringPrintFormater.CenterTextWithDashed("END REPORT"); strBody += "\r\n\r\n\r\n" + " --------------------" + " --------------------- "; strBody += "\r\n" + " Checked By" + " Prepared By "; return strBody; }
private string PrintReportA4() { string strBody = ""; stringPrintFormater = new StringPrintFormater(150); // strBody += "\r\n"; // strBody += "\r\n"; string hader = GetPrintDecorationText(PrintDecoration.HEADER); printReportLogoType = 1; string[] lines; char[] param = { '\n' }; lines = hader.Split(param); int i = 0; char[] trimParam = { '\r' }; string TotalHader = ""; foreach (string s in lines) { TotalHader += stringPrintFormater.CenterTextWithWhiteSpace(s.TrimEnd(trimParam)) + "\r\n"; } strBody += TotalHader; strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("INVENTORY REPORT"); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Date: From - " + dtpStart.Value.Date.ToShortDateString() + " to " + dtpEnd.Value.Date.ToShortDateString()); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Total Order: " + oItemList.Count, "Order Total: " + lelOrderTotal_Value.Text); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Total Guest: " + lelGuest_Value.Text, "Service Charge: " + lelServiceCharge_Value.Text); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Food Price: " + lelFoodPrice_Value.Text, "Delivery Charge: " + "0.00"); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Non Food Price: " + lelNonfoodPrice_Value.Text, "Discount: " + lelDiscount_Value.Text); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Take Away Food Price: " + lelTakeAwayFoodPrice_Value.Text, "Total Paid (ExVat): " + lelTotalpaidEXVAT_value.Text); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Take Away Non Food Price: " + lelTakeAwayNonfoodPrice_Value.Text, "Total Paid (IncVat): " + lelTotalpaidIncVAT_value.Text); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Table Food Price: " + lelTableFoodPrice_Value.Text, "Vat Total: " + lelVat_Value.Text); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("Table Non Food Price: " + lelTableNonfoodPrice_Value.Text, "Cash: " + lelCashTotal_value.Text); //strBody += "\r\n" + stringPrintFormater.ItemLabeledText("", "EFT: " + lelEftTotal_value.Text); // strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("DETAILS"); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n"; strBody += stringPrintFormater.GridCell("Item Name", 100, false); strBody += stringPrintFormater.GridCell("Item Price", 15, true); strBody += stringPrintFormater.GridCell("Item Qty", 10, true); strBody += stringPrintFormater.GridCell("Total Amount(" + Program.currency + ")", 25, true); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); foreach (DataRow row in tableReport.Rows) { strBody += "\r\n"; strBody += stringPrintFormater.GridCell(row[1].ToString(), 100, false); strBody += stringPrintFormater.GridCell(row[2].ToString(), 15, true); strBody += stringPrintFormater.GridCell(row[3].ToString(), 10, true); strBody += stringPrintFormater.GridCell(row[4].ToString(), 25, true); strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); } strBody += "\r\n" + "Total No. of Items Sold: " + lblNoOfItemsSold.Text; strBody += "\r\n" + "Total Orders: " + lblTotalQty.Text; strBody += "\r\n" + "Total Order Amount (£): " + lblTotalAmount.Text; strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); strBody += "\r\n" + "Printed at : " + DateTime.Now.ToString("dd MMMM yyyy") + "-" + DateTime.Now.ToString("hh:mm:ss tt"); strBody += "\r\n" + stringPrintFormater.CenterTextWithDashed("END REPORT"); //strBody += "\r\n" + stringPrintFormater.CreateDashedLine(); //strBody += "\r\n" + stringPrintFormater.CenterTextWithWhiteSpace("Developed By: www.ibacs.co.uk") + "\r\n\n"; return strBody; }