コード例 #1
0
 public static void AddHeaderCellDetailMill(PdfPTable tableLayout, MillDetailVM millDetail, int resultCount)
 {
     PDFGenerateUtilityHelper.AddCellToBody(tableLayout, millDetail.TCNumber, 1);
     PDFGenerateUtilityHelper.AddCellToBody(tableLayout, millDetail.TCDate.ToShortDateString(), 1);
     PDFGenerateUtilityHelper.AddCellToBody(tableLayout, millDetail.MillName, 1);
     PDFGenerateUtilityHelper.AddCellToBody(tableLayout, resultCount.ToString(), 1);
 }
コード例 #2
0
 public static void AddHeaderCellDetailLab(PdfPTable tableLayout, LabReportVM labReport, int resultCount)
 {
     PDFGenerateUtilityHelper.AddCellToBody(tableLayout, labReport.TCNumber, 1);
     PDFGenerateUtilityHelper.AddCellToBody(tableLayout, labReport.TCDate.ToShortDateString(), 1);
     PDFGenerateUtilityHelper.AddCellToBody(tableLayout, labReport.LabName, 1);
     PDFGenerateUtilityHelper.AddCellToBody(tableLayout, resultCount.ToString(), 1);
 }
コード例 #3
0
        private static void GetHeatChartHeadingPDFTable(PdfPTable tableLayout)
        {
            string headerImagePath = HttpContext.Current.Server.MapPath("~/content/images/" + "metalplants_Header.png");

            iTextSharp.text.Image headerImage = iTextSharp.text.Image.GetInstance(headerImagePath);

            PDFGenerateUtilityHelper.AddHeaderImageIntoCell(tableLayout, headerImage, 12);
        }
コード例 #4
0
        private void GetHeatChartFooterPDFTable(PdfPTable tableLayout)
        {
            string headerImagePath = HttpContext.Current.Server.MapPath("~/content/images/" + ConfigurationReader.CompanyAddressImageName);

            iTextSharp.text.Image headerImage = iTextSharp.text.Image.GetInstance(headerImagePath);

            PDFGenerateUtilityHelper.AddFooterImageIntoCell(tableLayout, headerImage, 12);
        }
コード例 #5
0
        private static void GetHeatChartDetailHeadingPDFTable(PdfPTable tableLayout, HeatChartHeaderVM heatChartHeaderVM)
        {
            List <string> sheetNoList = new List <string>();

            string sheetNos = string.Empty;

            if (heatChartHeaderVM.HeatChartDetails != null)
            {
                sheetNoList = heatChartHeaderVM.HeatChartDetails.Select(x => x.SheetNo).Distinct().ToList();

                sheetNos = string.Join(", ", sheetNoList);
            }

            PDFGenerateUtilityHelper.AddCellToDetailHeading(tableLayout, "MATERIAL HEAT CHART", 10);
            PDFGenerateUtilityHelper.AddCellToDetailHeadingSheet(tableLayout, string.Format("{0} : {1}", "Sheet No", sheetNos), 2);
        }
コード例 #6
0
        public static void GetHeatchartDetailHeader(PdfPTable tableLayout)
        {
            //Add Header

            PDFGenerateUtilityHelper.AddCellToDetailHeader(tableLayout, "Part No", 1);
            PDFGenerateUtilityHelper.AddCellToDetailHeader(tableLayout, "Description", 2);

            PDFGenerateUtilityHelper.AddCellToDetailHeaderSpecified(tableLayout, "Specified", 2);
            PDFGenerateUtilityHelper.AddCellToDetailHeaderUtilized(tableLayout, "Utilized", 2);

            PDFGenerateUtilityHelper.AddCellToDetailHeader(tableLayout, "CT No/HT No", 1);
            PDFGenerateUtilityHelper.AddCellToDetailHeader(tableLayout, "TC No", 1);
            PDFGenerateUtilityHelper.AddCellToDetailHeader(tableLayout, "TC Date", 1);
            PDFGenerateUtilityHelper.AddCellToDetailHeader(tableLayout, "LAB/MFG", 1);
            PDFGenerateUtilityHelper.AddCellToDetailHeader(tableLayout, "Doc Sr.No", 1);
        }
コード例 #7
0
        private static void GetHeatChartHeader(PdfPTable tableLayout, HeatChartHeaderVM heatChartHeaderVM)
        {
            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "Customer", "  ", "  ", heatChartHeaderVM.CustomerSelected?.Name), 6);
            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "Mfg By", "  ", "  ", ""), 6);

            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "PO Number", "  ", "  ", heatChartHeaderVM.CustomerPONumber), 3);
            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "PO Date", "  ", "  ",
                                                                                    heatChartHeaderVM.CustomerPODate != null ? heatChartHeaderVM.CustomerPODate?.ToShortDateString() : string.Empty), 3);

            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "Equipment Name", "  ", "  ", heatChartHeaderVM.CustomerPOEquipment), 6);

            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "Plant / Project", "  ", "  ", heatChartHeaderVM.Plant), 6);
            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "Drawing Number", "  ", "  ", heatChartHeaderVM.DrawingNumber), 4);
            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "Drawing Revision", "  ", "  ", heatChartHeaderVM.DrawingRevision), 2);

            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "Inspection By", "  ", "  ", heatChartHeaderVM.ThirdPartyInspectionSelected.Name), 6);
            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "Tag Number", "  ", "  ", heatChartHeaderVM.TagNumber), 4);
            PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}{1}:{2}{3}", "Quantity", "  ", "  ", heatChartHeaderVM.NoOfEquipment), 2);
        }
コード例 #8
0
        private static void GetHeatChartDetailsPDFTable(Document doc, PdfPTable tableLayout, List <HeatChartDetailsVM> heatChartDetailList)
        {
            // Add Body

            if (heatChartDetailList != null && heatChartDetailList.Any())
            {
                var heatChartGroupedResult = heatChartDetailList.GroupBy(x => new { x.PartNumber }).ToList();

                int  pagelimit   = 10;
                bool IsFirstPage = true;
                if (heatChartGroupedResult != null && heatChartGroupedResult.Any())
                {
                    //int pageCounter = 1;
                    int i = 1;
                    foreach (var groupResult in heatChartGroupedResult)
                    {
                        int resultCount = groupResult.Count();

                        int millLabCount = groupResult.Count(x => x.MaterialRegisterSubSeriesSelected != null &&
                                                             x.MaterialRegisterSubSeriesSelected.LabReport != null &&
                                                             !string.IsNullOrWhiteSpace(x.MaterialRegisterSubSeriesSelected.LabReport.LabName) &&
                                                             x.MaterialRegisterSubSeriesSelected.MillDetail != null &&
                                                             !string.IsNullOrWhiteSpace(x.MaterialRegisterSubSeriesSelected.MillDetail.MillName));

                        resultCount += millLabCount;

                        PDFGenerateUtilityHelper.AddCellToBodyRowSpan(tableLayout, groupResult.FirstOrDefault().PartNumber, 1, resultCount);
                        PDFGenerateUtilityHelper.AddCellToBodyRowSpan(tableLayout, groupResult.FirstOrDefault().PartNumberDescription, 2, resultCount);

                        PDFGenerateUtilityHelper.AddCellToBodyRowSpan(tableLayout, groupResult.FirstOrDefault().SpecificationSelected?.Name, 1, resultCount);
                        PDFGenerateUtilityHelper.AddCellToBodyRowSpan(tableLayout, groupResult.FirstOrDefault().Dimension, 1, resultCount);
                        PDFGenerateUtilityHelper.AddCellToBodyRowSpan(tableLayout, groupResult.FirstOrDefault().MaterialRegisterHeaderSelected?.SpecificationSelected?.Name, 1, resultCount);
                        PDFGenerateUtilityHelper.AddCellToBodyRowSpan(tableLayout, groupResult.FirstOrDefault().MaterialRegisterHeaderSelected?.Dimension, 1, resultCount);

                        foreach (var group in groupResult)
                        {
                            if ((group.MaterialRegisterSubSeriesSelected?.MillDetail != null && !string.IsNullOrWhiteSpace(group.MaterialRegisterSubSeriesSelected?.MillDetail.TCNumber)) &&
                                (group.MaterialRegisterSubSeriesSelected?.LabReport != null && !string.IsNullOrWhiteSpace(group.MaterialRegisterSubSeriesSelected?.LabReport.LabName)))
                            {
                                PDFGenerateUtilityHelper.AddCellToBodyRowSpan(tableLayout, group.MaterialRegisterSubSeriesSelected?.SubSeriesNumber, 1, 2);
                            }
                            else
                            {
                                PDFGenerateUtilityHelper.AddCellToBodyRowSpan(tableLayout, group.MaterialRegisterSubSeriesSelected?.SubSeriesNumber, 1, 1);
                            }

                            if (group.MaterialRegisterSubSeriesSelected?.MillDetail != null && !string.IsNullOrWhiteSpace(group.MaterialRegisterSubSeriesSelected?.MillDetail.TCNumber))
                            {
                                AddHeaderCellDetailMill(tableLayout, group.MaterialRegisterSubSeriesSelected?.MillDetail, i);
                                i++;
                            }
                            if (group.MaterialRegisterSubSeriesSelected?.LabReport != null && !string.IsNullOrWhiteSpace(group.MaterialRegisterSubSeriesSelected?.LabReport.LabName))
                            {
                                AddHeaderCellDetailLab(tableLayout, group.MaterialRegisterSubSeriesSelected?.LabReport, i);
                                i++;
                            }
                        }

                        //if (IsFirstPage && i > 6)
                        //{
                        //    IsFirstPage = false;
                        //    doc.Add(tableLayout);
                        //    tableLayout = new PdfPTable(12);
                        //    //tableLayout.TotalWidth = doc.PageSize.Width - 100f;
                        //    tableLayout.WidthPercentage = 95.6f;
                        //    doc.NewPage();
                        //}
                        //else
                        //{
                        //    if (i / pagelimit == pageCounter)
                        //    {
                        //        if (i % pagelimit > 2)
                        //        {
                        //            pageCounter = pageCounter + 2;
                        //        }
                        //        else
                        //        {
                        //            pageCounter = pageCounter + 1;
                        //        }
                        //        doc.Add(tableLayout);
                        //        tableLayout = new PdfPTable(12);
                        //        //tableLayout.TotalWidth = doc.PageSize.Width - 100f;
                        //        tableLayout.WidthPercentage = 95.6f;
                        //        doc.NewPage();
                        //    }
                        //}
                    }
                }

                doc.Add(tableLayout);
            }
        }
コード例 #9
0
 private static void GetHeatChartDetailHeadingPDFTable(PdfPTable tableLayout)
 {
     PDFGenerateUtilityHelper.AddCellToDetailHeading(tableLayout, "Material Heat Chart", 12);
 }
コード例 #10
0
 private void GetHeatChartDetailHeadingPDFTable(PdfPTable tableLayout, HeatChartHeaderVM heatChartHeaderVM)
 {
     PDFGenerateUtilityHelper.AddCellToBodyHeader(tableLayout, string.Format("{0}:{1}", "Heat Chart No", heatChartHeaderVM.HeatChartNumber), 12);
 }