本文整理匯總了C#中iTextSharp.text.pdf.PdfPTable.addCell方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfPTable.addCell方法的具體用法?C# PdfPTable.addCell怎麽用?C# PdfPTable.addCell使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfPTable
的用法示例。
在下文中一共展示了PdfPTable.addCell方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddAddress
public void AddAddress()
{
PdfPTable pt = new PdfPTable(2);
pt.WidthPercentage = 100;
pt.addCell(CellValue(@"Purchase Order Address:", false, boldfont, 0));
pt.addCell(CellValue(@" ", false, boldfont, 0));
pt.addCell(CellValue(@"MULTEK TECHNOLOGIES LIMITED" + System.Environment.NewLine +
@"1st Floor, The Exchange," + System.Environment.NewLine +
@"18 Cybercity, " + System.Environment.NewLine +
@"Ebene, REPUBLIC OF MAURITIUS" + System.Environment.NewLine +
@"Fax the PO copy to Multek Hong Kong", false, defaultfont, 0));
pt.addCell(CellValue(@" " + System.Environment.NewLine +
@"Telephone # (230) 454 3200" + System.Environment.NewLine +
@"Fax # (230) 454 3202" + System.Environment.NewLine +
@"Fax # (852) 2276 1122" + System.Environment.NewLine, false, defaultfont, 0));
doc.Add(pt);
}
示例2: ConvertDataTableToPDF
//導出PDF文件方法
/// <summary>
/// DataTable導出到PDF
/// </summary>
/// <param name="datatable">DataTable</param>
/// <param name="PDFFilePath">導出的PDF存儲路徑</param>
/// <param name="PdfSaveTitle">導出的文件名</param>
/// <param name="FontPath">字體路徑</param>
/// <param name="FontSize">字體大小</param>
/// <param name="widthmz">每一列寬度</param>
/// <returns>布爾值</returns>
public static bool ConvertDataTableToPDF(DataTable datatable, string PDFFilePath, string PdfSaveTitle, Brush brush, float FontSize, float[] widthmz)
{
if (widthmz == null || widthmz.Length == 0)//如果每一列寬度未指定
{
widthmz = new float[datatable.Columns.Count];
for (int i = 0; i < datatable.Columns.Count; i++)
{
widthmz[i] = 30f;
}
}
//初始化一個目標文檔類
Document document = new Document(PageSize.A4, 10, 10, 25, 25);
//調用PDF的寫入方法流
//注意FileMode-Create表示如果目標文件不存在,則創建,如果已存在,則覆蓋。
PdfWriter writer = PdfWriter.getInstance(document, new FileStream(PDFFilePath, FileMode.Create));
try
{
System.Windows.Media.Color color = (System.Windows.Media.Color)ColorConverter.ConvertFromString(brush.ToString());
//打開目標文檔對象
document.Open();
// 添加頁眉
HeaderFooter header = new HeaderFooter(new Phrase(PdfSaveTitle), false);
document.Header = header;
// 添加頁腳
HeaderFooter footer = new HeaderFooter(new Phrase(PdfSaveTitle), true);
footer.Border = Rectangle.NO_BORDER;
document.Footer = footer;
//創建PDF文檔中的字體
BaseFont baseFont = BaseFont.createFont(@"C:\WINDOWS\Fonts\SIMFANG.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
//根據字體路徑和字體大小屬性創建字體
Font font = new Font(baseFont, FontSize);
font.setColor(color.R, color.G, color.B);
Paragraph pTitle = new Paragraph(new Chunk(PdfSaveTitle, FontFactory.getFont(FontFactory.HELVETICA, 12)));
document.Add(pTitle);
//根據數據表內容創建一個PDF格式的表
PdfPTable table = null;
table = new PdfPTable(widthmz);
//打印列名
for (int j = 0; j < datatable.Columns.Count; j++)
{
string ColumnName =datatable.Columns[j].ColumnName.ToString();
table.addCell(new Phrase(ColumnName, font));
}
//遍曆原table的內容
for (int i = 0; i < datatable.Rows.Count; i++)
{
for (int j = 0; j < datatable.Columns.Count; j++)
{
table.addCell(new Phrase(datatable.Rows[i][j].ToString(), font));
}
}
//在目標文檔中添加轉化後的表數據
document.Add(table);
}
catch (Exception ec)
{
ec.GetBaseException();
return false;
}
finally
{
//關閉目標文件
document.Close();
//關閉寫入流
writer.Close();
}
return true;
}
示例3: part5
private void part5()
{
Paragraph t = new Paragraph(10f, "" + "\n", smallBoldFont());
doc.Add(t);
PdfPTable table = new PdfPTable(1);
Paragraph p = new Paragraph(11f, "Term and Conditions", terms);
PdfPCell c1 = new PdfPCell(p);
c1.Border = 0;
table.addCell(c1);
Paragraph p2 = new Paragraph(10f, "Lead-time is quoted in business days (excludes weekends & holidays) and is subject to " +
"the availability of material and may change within 24 hours notice." + Environment.NewLine +
"Lead-time for non-standard materials, approximately three weeks and is subject to confirmation. Prices are valid for 30 days from date of quote." + Environment.NewLine +
"Purchase order & data files, as stated below, must be received no later than 10:00AM for that day to be applied." + Environment.NewLine +
"All quote information is subject to change after receipt of Gerber data files, fabrication drawings & specifications." +
"Prices are only applicable for new purchase orders unless specified. Acceptance of a purchase order is contingent upon " +
"satisfactory credit approval. Deliveries maybe subject to applicable local sales taxes, VAT.", terms2);
//p2.SpacingAfter = 4f;
PdfPCell c2 = new PdfPCell(p2);
c2.Border = 0;
table.addCell(c2);
Paragraph p3 = new Paragraph(10f, "This quote is provided in accordance with the Multek Warranty Policy Terms and Conditions.", terms2);
//p3.SpacingAfter = 6f;
PdfPCell c3 = new PdfPCell(p3);
c3.Border = 0;
table.addCell(c3);
Paragraph x1 = new Paragraph(11f, "Policy for Cancellations", terms);
PdfPCell c4 = new PdfPCell(x1);
c4.Border = 0;
table.addCell(c4);
Paragraph x2 = new Paragraph(11f, "- 45 calendar days for the order" + Environment.NewLine +
"- 60 days for standard material" + Environment.NewLine +
"- 90 days for \"special\" material ( i.e. 13 Teflon, Cyanate Ester, GTEK, etc..)", terms2);
PdfPCell c5 = new PdfPCell(x2);
c5.Border = 0;
table.addCell(c5);
//x2.SpacingAfter = 8f;
//Paragraph ad = new Paragraph(11f, "ADDITIONAL NOTES:", termsB);
//ad.SpacingBefore = 2f;
//doc.Add(ad);
//Paragraph ad2 = new Paragraph(11f);
//ad2.Add(new Chunk("-Minimum Order per Delivery: ", termsB));
//ad2.Add(new Chunk("= " + row["Currency"].ToString() + row["MOV"].ToString(), timesBlue));
//ad2.Add(new Chunk(Environment.NewLine + "-" + row["Notes"].ToString() +
// Environment.NewLine + "-" + row["Notes2"].ToString(), termsB));
/*
Paragraph ad2 = new Paragraph(11f, "-Minimum Order per Delivery: = " + row["currency"].ToString()+ row["moq2"].ToString() +
Environment.NewLine+"-"+row["note1"].ToString()+
Environment.NewLine + "-" + row["note2"].ToString(), termsB);
*/
//ad2.SpacingAfter = 5f;
//doc.Add(ad2);
Paragraph inf = new Paragraph(11f, "Thanks & Best regards,", termsB);
//inf.SpacingAfter = 3f;
PdfPCell c6 = new PdfPCell(inf);
c6.Border = 0;
table.addCell(c6);
Paragraph inf0 = new Paragraph(12f, row["PrimaryContact"].ToString(), termsB);
//inf0.SpacingAfter = 3f;
PdfPCell c7 = new PdfPCell(inf0);
c7.Border = 0;
table.addCell(c7);
Paragraph inf1 = new Paragraph(12f, "Direct Line : " + row["Phone"].ToString(), pageFont());
PdfPCell c8 = new PdfPCell(inf1);
c8.Border = 0;
table.addCell(c8);
Paragraph inf2 = new Paragraph(11f, "Direct Fax : " + row["Fax"].ToString(), pageFont());
PdfPCell c9 = new PdfPCell(inf2);
c9.Border = 0;
table.addCell(c9);
Paragraph inf3 = new Paragraph(11f, "Cell Phone : " + row["CellPhone"].ToString(), pageFont());
PdfPCell c10 = new PdfPCell(inf3);
c10.Border = 0;
table.addCell(c10);
Paragraph inf4 = new Paragraph(11f, "Email Address : " + row["Email"].ToString(), pageFont());
PdfPCell c11 = new PdfPCell(inf4);
c11.Border = 0;
table.addCell(c11);
doc.Add(table);
//Paragraph inf6 = new Paragraph(11f, "1", pageFont());
//doc.Add(inf6);
//Paragraph inf7 = new Paragraph(11f, "Rev. B 11/10/2011", pageFont());
//doc.Add(inf7);
/*
Policy for Cancellations
*/
}
示例4: part4
private void part4()
{
Paragraph p = new Paragraph(10f, "" + "\n", smallBoldFont());
doc.Add(p);
PdfPTable table = new PdfPTable(4);
table.TotalWidth = TBWidth;
//table.LockedWidth = true;
//table.SpacingAfter = 10f;
float[] widths = new float[] { 20f, 30f, 20f, 30f };
table.setWidths(widths);
PdfPCell c = titleCell("Conditions");
c.Colspan = 4;
table.addCell(c);
table.addCell(addCell("Card Size", true, false));
string cs = "";
if (row["UnitSizeLength"].ToString().Trim() + row["UnitSizeWidth"].ToString().Trim() != "")
cs = row["UnitSizeLength"].ToString() + " x " + row["UnitSizeWidth"].ToString() + " " + row["UnitType"].ToString();
table.addCell(getValue(cs));
table.addCell(addCell("Material", true, false));
//if (string.IsNullOrEmpty(row["LaminateType"].ToString()))
//{
// table.addCell(getValue(row["MaterialCategory"].ToString() + "" + row["LaminateType"].ToString()));
//}
//else
//{
// table.addCell(getValue(row["MaterialCategory"].ToString() + " (" + row["LaminateType"].ToString() + ")"));
//}
table.addCell(getValue(row["MaterialCategory"].ToString()));
table.addCell(addCell("Array Size", true, false));
string ars = " ";
if (row["ArraySizeWidth"].ToString().Trim() + row["ArraySizeLength"].ToString().Trim() != "")
ars = row["ArraySizeWidth"].ToString() + " x " + row["ArraySizeLength"].ToString() + " " + row["UnitType"].ToString() + " ";
if (row["UnitPerArray"].ToString().Trim() != "")
ars += "(" + row["UnitPerArray"].ToString() + " up)";
table.addCell(getValue(ars));
table.addCell(addCell("Thickness (mm/inch)", true, false));
table.addCell(getValue(row["BoardThickness"].ToString() + " (" + row["UnitType"].ToString() + ")"));
table.addCell(addCell("# of Layers", true, false));
string viaStructure = row["ViaStructure"].ToString();
if (!string.IsNullOrEmpty(viaStructure))
{
table.addCell(getValue(row["LayerCount"].ToString() + " [ " + viaStructure + " ] "));
}
else
{
table.addCell(getValue(row["LayerCount"].ToString()));
}
table.addCell(addCell("Copper (ext/int)", true, false));
table.addCell(getValue(row["Copper"].ToString()));
table.addCell(addCell("# of Holes", true, false));
table.addCell(getValue(row["Holes"].ToString() + " " + row["UnitOrArray"].ToString()));
table.addCell(addCell("Finish", true, false));
table.addCell(getValue(row["Finishing"].ToString()));
table.addCell(addCell("Smallest Hole", true, false));
table.addCell(getValue(row["SmallestHole"].ToString() + " " + row["UnitType"].ToString()));
table.addCell(addCell("Line & Space (ext)", true, false));
string lno = row["LnO"].ToString();
if (string.IsNullOrEmpty(lno.Trim()))
{
table.addCell(getValue(""));
}
else
{
table.addCell(getValue(row["LnO"].ToString() + " " + row["UnitType"].ToString()));
}
table.addCell(addCell("Impedance (Y/N)", true, false));
table.addCell(getValue(row["Imped"].ToString()));
table.addCell(addCell("Line & Space (int)", true, false));
string lni = row["LnI"].ToString();
if (string.IsNullOrEmpty(lni.Trim()))
{
table.addCell(getValue(" "));
}
else
{
table.addCell(getValue(row["LnI"].ToString() + " " + row["UnitType"].ToString()));
}
string s = " ";
if (Value("USize") != "")
s = Value("USize") + " ";
if (Value("UQty") != "")
s += "(" + Value("UQty") + ")";
table.addCell(addCell("Micro Via Size (Qty)", true, false));
table.addCell(getValue(s));
table.addCell(addCell("Outline Profiling", true, false));
table.addCell(getValue(Value("Outline")));
table.addCell(addCell("Blind/Buried Via", true, false));
s = " ";
if (Value("BlindSize") != "")
s = Value("BlindSize") + " ";
if (Value("BlindSize") != "")
//.........這裏部分代碼省略.........
示例5: part3
private void part3()
{
Paragraph p = new Paragraph(10f, "" + "\n", smallBoldFont());
doc.Add(p);
PdfPTable table = new PdfPTable(4);
table.TotalWidth = TBWidth;
//table.LockedWidth = true;
//table.SpacingAfter = 10f;
float[] widths = new float[] { 25f, 25f, 25f, 25f };
table.setWidths(widths);
table.addCell(titleCellC("NRE Charge"));
table.addCell(titleCellC(" "));
table.addCell(titleCell("Min.Order Value"));
table.addCell(getValue(showCurrencyKey(row["MOV"].ToString())));
table.addCell(addCell("Set-up Charge", true, false));
table.addCell(getValue(showCurrencyKey(row["SetupCharge"].ToString())));
table.addCell(titleCell("Min.Order Qty"));
table.addCell(getValue(row["MOQ"].ToString()));
table.addCell(addCell("E-Testing Charge", true, false));
table.addCell(getValue(showCurrencyKey(row["EtestCharge"].ToString())));
table.addCell(titleCell("Shipment Term"));
string shipterms=row["ShipmentTerms"].ToString();
if(string.IsNullOrEmpty(shipterms.Trim()))
{
shipterms = "FCA HK - Free Carrier";
}
shipterms = shipterms+" "+row["Location"].ToString();
table.addCell(getValue(shipterms));
table.addCell(addCell("Tooling Charge", true, false));
table.addCell(getValue(showCurrencyKey(row["ToolingCharge"].ToString())));
table.addCell(titleCell("Payment Terms"));
table.addCell(getValue(row["PayTerms"].ToString()));
doc.Add(table);
}
示例6: part2
private void part2()
{
Paragraph p = new Paragraph(10f, "Thank you for you inquiry, we are pleased to provide you quotation for our products as follow:", smallBoldFont());
//p.SpacingAfter = 2f;
//doc.Add(p);
PdfPTable table = new PdfPTable(6);
table.TotalWidth = TBWidth;
//table.LockedWidth = true;
float[] widths = new float[] { 28f, 15f, 11f, 9f, 10f, 27f };
table.setWidths(widths);
//table.SpacingAfter = 10f;
PdfPCell c1 = new PdfPCell(p);
//c1.FixedHeight = 33f;
c1.Colspan = 6;
c1.Border = 0;
table.addCell(c1);
table.addCell(titleCellC("Part Number"));
table.addCell(titleCellC("Lead-Time"));
table.addCell(titleCellC("Qty"));
table.addCell(titleCellC("Currency"));
table.addCell(titleCellC("Unit Price Each"));
table.addCell(titleCellC("Remarks"));
string programme = "";
string PartInfor = "";
if (row["ProgramName"].ToString().Trim() != "")
programme = row["ProgramName"].ToString();
if (row["CustomerPartNumber"].ToString().Trim() != "")
PartInfor += ((PartInfor == "") ? "" : ", ") + row["CustomerPartNumber"].ToString().Trim();
if (row["Revision"].ToString().Trim() != "")
PartInfor += ((PartInfor == "") ? "" : ", ") + row["Revision"].ToString().Trim();
table.addCell(getValue(PartInfor));
table.addCell(getValue(row["LeadTime"].ToString()));
table.addCell(getValue(row["Price1Qty"].ToString()));
table.addCell(getValue(row["Currency"].ToString()));
table.addCell(getValue(row["UnitPrice1"].ToString()));
string rm = Value("Remark1");
int len = rm.Length;
table.addCell(getValue(rm));
if (len > 100)
table.addCell(addCell(" ", true, false));
else
table.addCell(addCell(" ", true, false));
table.addCell(addCell(" ", true, false));
table.addCell(getValue(row["Price2Qty"].ToString()));
table.addCell(getValue(showCurrency(row["UnitPrice2"].ToString())));
table.addCell(getValue(row["UnitPrice2"].ToString()));
table.addCell(getValue(row["Remark2"].ToString()));
if (len > 150)
table.addCell(addCell(" ", true, false));
else
table.addCell(addCell(" ", true, false));
table.addCell(addCell(" ", true, false));
table.addCell(getValue(row["Price3Qty"].ToString()));
table.addCell(getValue(showCurrency(row["UnitPrice3"].ToString())));
table.addCell(getValue(row["UnitPrice3"].ToString()));
table.addCell(getValue(row["Remark3"].ToString()));
if (len > 200)
table.addCell(addCell(" ", true, false));
else
table.addCell(addCell(" ", true, false));
table.addCell(addCell(" ", true, false));
table.addCell(getValue(row["Price4Qty"].ToString()));
table.addCell(getValue(showCurrency(row["UnitPrice4"].ToString())));
table.addCell(getValue(row["UnitPrice4"].ToString()));
table.addCell(getValue(row["Remark4"].ToString()));
if (len > 250)
table.addCell(addCell(" ", true, false));
else
table.addCell(addCell(" ", true, false));
table.addCell(addCell(" ", true, false));
table.addCell(getValue(row["Price5Qty"].ToString()));
table.addCell(getValue(showCurrency(row["UnitPrice5"].ToString())));
table.addCell(getValue(row["UnitPrice5"].ToString()));
table.addCell(getValue(row["Remark5"].ToString()));
doc.Add(table);
}
示例7: part1
private void part1()
{
try
{
PdfPTable table = new PdfPTable(4);
table.TotalWidth = TBWidth;
//table.LockedWidth = true;
float[] widths = new float[] { 15f, 45f, 15f, 25f };
table.setWidths(widths);
//table.SpacingAfter = 5f;
table.addCell(addCell("Company :", false, true));
string company = row["OEM"].ToString();
company += (row["CEM"].ToString().Trim() != "") ? " - " + row["CEM"].ToString() : "";
table.addCell(addCell(company, false, true));
table.addCell(addCell("Date :", false, true));
string customerquotedate=row["CustomerQuoteDate"].ToString();
if(string.IsNullOrEmpty(customerquotedate.Trim()))
{
customerquotedate = DateTime.Now.ToString("dd-MMM-yyyy");
}
DateTime customerdate=new DateTime();
DateTime.TryParse(customerquotedate,out customerdate);
table.addCell(addCell(customerdate.ToString("dd-MMM-yyyy"), false, true));
table.addCell(addCell("Attention :", false, true));
table.addCell(addCell(row["CustomerContact"].ToString(), false, true));
table.addCell(addCell("RFQ# :", false, true));
string extnumber = row["ExtNumber"].ToString();
if (row["ExtNumber"].ToString().IndexOf('-') > 0)
{
extnumber=row["ExtNumber"].ToString().Substring(0, row["ExtNumber"].ToString().IndexOf('-'));
}
table.addCell(addCell(extnumber, false, true));
doc.Add(table);
Paragraph p = new Paragraph(10f, ""+"\n", smallBoldFont());
doc.Add(p);
}
catch (Exception ex)
{
message = ex.ToString();
throw ex;
}
}
示例8: addHeader
private void addHeader()
{
//string image_url = "http://mcnnt800.asia.ad.flextronics.com/Common/Content/Images/Multek_LOGO.PNG";
string image_url = HttpContext.Current.Server.MapPath("~/tmp/logo.png");
iTextSharp.text.Image png = iTextSharp.text.Image.getInstance(new Uri(image_url));
png.scaleToFit(140, 140);
png.Interpolation = true;
//png.setAbsolutePosition(RLMargin, doc.PageSize.Height - 50);
// doc.Add(png);
PdfPTable table2 = new PdfPTable(2);
table2.TotalWidth = TBWidth;
//table2.LockedWidth = true;
PdfPCell c1 = new PdfPCell(new Phrase(new Chunk(png,10,20)));
c1.Border = 0;
// c1.FixedHeight = 33f;
table2.addCell(c1);
PdfPCell ch = new PdfPCell(new Phrase(new Chunk("www.multek.com", bigBoldFont())));
ch.HorizontalAlignment = Element.ALIGN_RIGHT;
ch.VerticalAlignment = Element.ALIGN_MIDDLE;
ch.Border = 0;
ch.FixedHeight = 33f;
table2.addCell(ch);
// table2.SpacingAfter = 4f;
//ch.Rowspan
Phrase p = new Phrase(new Chunk("Quotation", bigBoldFont()));
//p.Font.Size = 14f;
PdfPCell cell = new PdfPCell(p);
cell.MinimumHeight = 18f;
cell.VerticalAlignment = Element.ALIGN_TOP;
cell.HorizontalAlignment = Element.ALIGN_CENTER;
cell.BackgroundColor = color;
cell.Colspan = 2;
table2.addCell(cell);
// table2.SpacingAfter = 4f;
doc.Add(table2);
}
示例9: PrintContent
/// <summary>
/// 打印主內容
/// </summary>
private void PrintContent()
{
PdfPTable pdfTable = new PdfPTable(Content.ColumnsCount);
pdfTable.WidthPercentage = 110;
Font font = new Font(BaseFont, 9);
for (int i = 0; i < Content.RowsCount; i++)
{
for (int j = 0; j < Content.ColumnsCount; j++)
{
Paragraph par = new Paragraph(string.Format("{0}", Content.GetValue(i, j)), font);
pdfTable.addCell(par);
}
}
PdfDoc.Add(pdfTable);
}
示例10: AddLeadTimePayShipTerms
public void AddLeadTimePayShipTerms()
{
PdfPTable pt = new PdfPTable(2);
pt.WidthPercentage = 100;
pt.addCell(CellValue("3. Production Lead-time, Payment & Shipment Terms", false, boldfont, 0, 2));
pt.addCell(CellValue("Lead Time of FPC/RFPC", true, defaultfont, 0, true));
string leadTimeText = string.Format("Production first article parts will ship {0} after receipt of order.\r\n", maindt.Rows[rowid]["LeadTime"].ToString());
leadTimeText += "Lead time for follow on production orders is 4 weeks with forecast, or 6 weeks without forecast.\r\n";
leadTimeText += "Actual lead time depends on material and factory loading.";
pt.addCell(CellValue(leadTimeText, true, bluefont, 0, false));
pt.addCell(CellValue("Lead Time of BOM", true, defaultfont, 0, true));
pt.addCell(CellValue(maindt.Rows[rowid]["SMTBOMLeadtime"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Shipment Term", true, defaultfont, 0, true));
string strShipmentTerms = string.Empty;
foreach (string shipmentTerms in shipmentTermsList)
{
strShipmentTerms += shipmentTerms + "\n";
}
pt.addCell(CellValue(strShipmentTerms, true, bluefont, 0, false));
pt.addCell(CellValue("Payment Term", true, defaultfont, 0, true));
//pt.addCell(CellValue(maindt.Rows[rowid]["PayTerms"].ToString(), true, bluefont, 0, false));
string strPayTerms = string.Empty;
foreach (string payTerms in payTermsList)
{
strPayTerms += "Payment terms are " + payTerms + "\n";
}
strPayTerms += "Production tooling will be invoiced 100% upon order placement and 100% upon shipment of first article circuits.";
pt.addCell(CellValue(strPayTerms, true, bluefont, 0, false));
doc.Add(pt);
}
示例11: AddToolingSummary
public void AddToolingSummary(int rfqId)
{
DataTable dt = GetToolingSummary(rfqId);
int rcount = dt.Rows.Count;
PdfPTable pt = new PdfPTable(1);
pt.WidthPercentage = 100;
pt.addCell(CellValue(@"2. Tooling Summary", false, boldfont, 0));
doc.Add(pt);
PdfPTable pt1 = new PdfPTable(rcount + 1);
pt1.WidthPercentage = 70;
pt1.HorizontalAlignment = Element.ALIGN_LEFT;
pt1.addCell(CellValue(@"Item", true, boldfont, 1, true));
for (int i = 0; i < rcount; i++)
{
pt1.addCell(CellValue(dt.Rows[i][1].ToString(), true, boldfont, 1, true));
}
List<float> widths = new List<float>();
for (int i = 0; i < rcount + 1; i++)
{
widths.Add(40f);
}
pt1.setWidths(widths.ToArray());
pt1.addCell(CellValue(@"Outline Tool-1", true, bluefont, 1, false));
for (int i = 0; i < rcount; i++)
{
pt1.addCell(CellValue(dt.Rows[i][2] is DBNull ? "N/A" : "$" + Convert.ToInt32(dt.Rows[i][2]).ToString("#,###"), true, bluefont, 1, false));
}
pt1.addCell(CellValue(@"Outline Tool-2", true, bluefont, 1, false));
for (int i = 0; i < rcount; i++)
{
pt1.addCell(CellValue(dt.Rows[i][3] is DBNull ? "N/A" : "$" + Convert.ToInt32(dt.Rows[i][3]).ToString("#,###"), true, bluefont, 1, false));
}
pt1.addCell(CellValue(@"Top Coverlay Tool", true, bluefont, 1, false));
for (int i = 0; i < rcount; i++)
{
pt1.addCell(CellValue(dt.Rows[i][4] is DBNull ? "N/A" : "$" + Convert.ToInt32(dt.Rows[i][4]).ToString("#,###"), true, bluefont, 1, false));
}
pt1.addCell(CellValue(@"Bottom Coverlay Tool", true, bluefont, 1, false));
for (int i = 0; i < rcount; i++)
{
pt1.addCell(CellValue(dt.Rows[i][5] is DBNull ? "N/A" : "$" + Convert.ToInt32(dt.Rows[i][5]).ToString("#,###"), true, bluefont, 1, false));
}
pt1.addCell(CellValue(@"E-test/CAD/Artwork/NRE", true, bluefont, 1, false));
for (int i = 0; i < rcount; i++)
{
pt1.addCell(CellValue(dt.Rows[i][6] is DBNull ? "N/A" : "$" + Convert.ToInt32(dt.Rows[i][6]).ToString("#,###"), true, bluefont, 1, false));
}
pt1.addCell(CellValue(@"SMT Tooling/Fixture", true, bluefont, 1, false));
for (int i = 0; i < rcount; i++)
{
pt1.addCell(CellValue(dt.Rows[i][7] is DBNull ? "N/A" : "$" + Convert.ToInt32(dt.Rows[i][7]).ToString("#,###"), true, bluefont, 1, false));
}
pt1.addCell(CellValue(@"Total", true, bluefont, 1, false));
for (int i = 0; i < rcount; i++)
{
pt1.addCell(CellValue(dt.Rows[i][8] is DBNull ? "N/A" : "$" + Convert.ToInt32(dt.Rows[i][8]).ToString("#,###"), true, bluefont, 1, false));
}
int eau = Convert.ToInt32(maindt.Rows[rowid]["VolumePerMonth"] is DBNull ? "0" : maindt.Rows[rowid]["VolumePerMonth"]);
pt1.addCell(CellValue(@"Remark:" + System.Environment.NewLine +
string.Format(@" MP Tooling charge based on run-rate of {0}K/Year.", eau / 1000), false, bluefont, 0, 7));
doc.Add(pt1);
}
示例12: AddTechniaclSummary
public void AddTechniaclSummary(int rfqId)
{
DataTable dt = GetProductInformation(rfqId);
if (dt != null && dt.Rows.Count > 0)
{
DataRow row = dt.Rows[0];
PdfPTable pt = new PdfPTable(4);
pt.WidthPercentage = 100;
pt.addCell(CellValue("4. Technical Summary", false, boldfont, 0, 4));
pt.addCell(CellValue("Conditions", true, boldfont, 0, true, 4));
pt.addCell(CellValue("Card Size", true, defaultfont, 0, false));
string unitSizeW = row["UnitSizeWidth"] is DBNull ? "" : row["UnitSizeWidth"].ToString();
string unitSizeL = row["UnitSizeLength"] is DBNull ? "" : row["UnitSizeLength"].ToString();
if (!string.IsNullOrEmpty(unitSizeW) && !string.IsNullOrEmpty(unitSizeL))
{
pt.addCell(CellValue(unitSizeW + "*" + unitSizeL + "mm", true, bluefont, 0, false));
}
else
{
pt.addCell(CellValue("N/A", true, bluefont, 0, false));
}
pt.addCell(CellValue("Material", true, defaultfont, 0, false));
pt.addCell(CellValue(row["MaterialCategory"] is DBNull ? "N/A" : row["MaterialCategory"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Array Size", true, defaultfont, 0, false));
string arraySizeW = row["ArraySizeWidth"] is DBNull ? "" : row["ArraySizeWidth"].ToString();
string arraySizeL = row["ArraySizeLength"] is DBNull ? "" : row["ArraySizeLength"].ToString();
if (!string.IsNullOrEmpty(arraySizeW) && !string.IsNullOrEmpty(arraySizeL))
{
pt.addCell(CellValue(arraySizeW + "*" + arraySizeL + "mm", true, bluefont, 0, false));
}
else
{
pt.addCell(CellValue("N/A", true, bluefont, 0, false));
}
pt.addCell(CellValue("Thickness (mm/inch)", true, defaultfont, 0, false));
pt.addCell(CellValue(row["BoardThickness"] is DBNull ? "N/A" : row["BoardThickness"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("# of Layers", true, defaultfont, 0, false));
string viaStructure = row["ViaStructure"].ToString();
if (!string.IsNullOrEmpty(viaStructure))
{
pt.addCell(CellValue(row["LayerCount"] is DBNull ?
"N/A" : row["LayerCount"].ToString() + " [ " + viaStructure + " ] ", true, bluefont, 0, false));
}
else
{
pt.addCell(CellValue(row["LayerCount"] is DBNull ? "N/A" : row["LayerCount"].ToString(), true, bluefont, 0, false));
}
pt.addCell(CellValue("Copper (ext/int)", true, defaultfont, 0, false));
pt.addCell(CellValue(row["Copper"] is DBNull ? "N/A" : row["Copper"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Construction", true, defaultfont, 0, false));
pt.addCell(CellValue(row["BoardConstruction"] is DBNull ? "N/A" : row["BoardConstruction"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Surface Finishing", true, defaultfont, 0, false));
pt.addCell(CellValue(row["Finishing"] is DBNull ? "N/A" : row["Finishing"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("# of Holes", true, defaultfont, 0, false));
pt.addCell(CellValue(row["Holes"] is DBNull ? "N/A" : row["Holes"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Line & Space (ext)", true, defaultfont, 0, false));
pt.addCell(CellValue(row["LnO"] is DBNull ? "N/A" : row["LnO"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Smallest Hole", true, defaultfont, 0, false));
pt.addCell(CellValue(row["SmallestHole"] is DBNull ? "N/A" : row["SmallestHole"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Line & Space (int)", true, defaultfont, 0, false));
pt.addCell(CellValue(row["LnI"] is DBNull ? "N/A" : row["LnI"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Impedance (Y/N)", true, defaultfont, 0, false));
pt.addCell(CellValue(row["Imped"] is DBNull ? "N/A" : row["Imped"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Outline Profiling", true, defaultfont, 0, false));
pt.addCell(CellValue(row["Outline"] is DBNull ? "N/A" : row["Outline"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Micro Via Size (Qty)", true, defaultfont, 0, false));
pt.addCell(CellValue(row["MicroViaSize"] is DBNull ? "N/A" : row["MicroViaSize"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("LPI Solder Mask(Y/N)", true, defaultfont, 0, false));
pt.addCell(CellValue(row["LPISolderMask"] is DBNull ? "N/A" : row["LPISolderMask"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("Blind / Buried Via", true, defaultfont, 0, false));
string blindQty = row["BlindQty"].ToString();
string blindSize = row["BlindSize"].ToString();
string buriedQty = row["BuriedQty"].ToString();
string buriedSize = row["BuriedSize"].ToString();
if ((!string.IsNullOrEmpty(blindQty) && blindQty != "0") ||
(!string.IsNullOrEmpty(blindSize) && blindQty != "0") ||
(!string.IsNullOrEmpty(buriedQty) && blindQty != "0") ||
(!string.IsNullOrEmpty(buriedSize) && blindQty != "0"))
{
pt.addCell(CellValue("Y", true, bluefont, 0, false));
}
else
{
pt.addCell(CellValue("N", true, bluefont, 0, false));
}
pt.addCell(CellValue("Pre-bending (Y/N)", true, defaultfont, 0, false));
pt.addCell(CellValue(row["PreBending"] is DBNull ? "N/A" : row["PreBending"].ToString(), true, bluefont, 0, false));
pt.addCell(CellValue("X out criteria", true, defaultfont, 0, false));
pt.addCell(CellValue(row["XOutAllowance"] is DBNull ? "N/A" : row["XOutAllowance"].ToString(), true, bluefont, 0, 4));
//.........這裏部分代碼省略.........
示例13: AddRemarkPricingAssumption
public void AddRemarkPricingAssumption(int rfqId)
{
PdfPTable pt = new PdfPTable(1);
pt.WidthPercentage = 100;
pt.addCell(CellValue(" ", false, boldfont, 0, 4));
pt.addCell(CellValue("Remarks & Pricing Assumption", true, boldfont, 0, true));
//string remarks = maindt.Rows[rowid]["Remarks"].ToString();
//if (!string.IsNullOrEmpty(remarks))
//{
// PdfPCell c1 = new PdfPCell(CellValue(remarks, true, bluefont, 0, false));
// c1.Border = Rectangle.LEFT | Rectangle.RIGHT | Rectangle.TOP;
// pt.addCell(c1);
//}
//else
//{
// pt.addCell(CellValue(" ", true, bluefont, 0, 4));
//}
bool isAllCurrSame = true;
if (priceCurr.Count > 0)
{
foreach (string curr1 in priceCurr)
{
foreach (string curr2 in priceCurr)
{
if (curr1 != curr2)
{
isAllCurrSame = false;
break;
}
}
if (!isAllCurrSame)
{
break;
}
}
}
else
{
isAllCurrSame = false;
}
string remarks = "This quote is budgetary pending review of the finalized design and specifications.\n";
if (isAllCurrSame)
{
remarks += string.Format("All prices shown are in {0}.\n", priceCurr[0]);
}
remarks += "Actual delivery schedules must be negotiated with and confirmed by Multek Flexible Circuits upon receipt of order.\n";
remarks += "Assumed stackup as below;\n";
PdfPCell c1 = new PdfPCell(CellValue(remarks, true, bluefont, 0, 4));
//c1.Border = Rectangle.LEFT | Rectangle.RIGHT | Rectangle.TOP;
pt.addCell(c1);
string filePath = GetGraphPath(rfqId);
if (!string.IsNullOrEmpty(filePath))
{
iTextSharp.text.Image png = iTextSharp.text.Image.getInstance(new Uri(filePath));
png.scaleToFit(400, 1200);
png.Interpolation = true;
PdfPCell c2 = new PdfPCell(new Phrase(new Chunk(png, 10, 20)));
c2.Border = Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM;
pt.addCell(c2);
}
doc.Add(pt);
//string image_url = HttpContext.Current.Server.MapPath("~/tmp/pic1.png");
//iTextSharp.text.Image png = iTextSharp.text.Image.getInstance(new Uri(image_url));
//png.scaleToFit(400, 1200);
//png.Interpolation = true;
//PdfPCell c2 = new PdfPCell(new Phrase(new Chunk(png, 10, 20)));
//c2.Border = Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM;
//pt.addCell(c2);
//doc.Add(pt);
}
示例14: AddQuotationTitle
public void AddQuotationTitle()
{
PdfPTable pt = new PdfPTable(1);
pt.WidthPercentage = 100;
PdfPCell cell = CellValue(@"Quotation", true, boldfont, 1);
cell.BackgroundColor = new Color(192, 192, 192);
pt.addCell(cell);
doc.Add(pt);
}
示例15: AddQuotationSummary
public void AddQuotationSummary(int rfqId)
{
PdfPTable pt = new PdfPTable(1);
pt.WidthPercentage = 100;
pt.addCell(CellValue(@"1. Quotation Summary", false, boldfont, 0));
doc.Add(pt);
PdfPTable pt1 = new PdfPTable(7);
pt1.WidthPercentage = 100;
pt1.addCell(CellValue(@"Item", true, boldfont, 1, true));
pt1.addCell(CellValue(@"Bare FPC/RFPC Price(USD)", true, boldfont, 1, true));
pt1.addCell(CellValue(@"BOM Price(USD)", true, boldfont, 1, true));
pt1.addCell(CellValue(@"Assembly Price(USD)", true, boldfont, 1, true));
pt1.addCell(CellValue(@"Total Price(USD)", true, boldfont, 1, true));
pt1.addCell(CellValue(@"MOQ(pcs)", true, boldfont, 1, true));
pt1.addCell(CellValue(@"Remark", true, boldfont, 1, true));
float[] widths = new float[] { 40f, 30f, 30f, 30f, 30f, 30f, 60f };
pt1.setWidths(widths);
DataTable dt = GetPriceDetail(rfqId);
foreach (DataRow dr in dt.Rows)
{
priceCurr.Add(dr[7].ToString());
if (!(dr[8] is DBNull) && !shipmentTermsList.Contains(dr[8].ToString()))
{
shipmentTermsList.Add(dr[8].ToString());
}
if (!(dr[9] is DBNull) && !payTermsList.Contains(dr[9].ToString()))
{
payTermsList.Add(dr[9].ToString());
}
for (int i = 0; i < 7; i++)
{
if (i == 1 || i == 2 || i == 3 || i == 4)
{
if (dr[i] is DBNull || dr[i].ToString() == "0")
{
pt1.addCell(CellValue("N/A", true, bluefont, 1, false));
}
else
{
pt1.addCell(CellValue("$" + dr[i].ToString(), true, bluefont, 1, false));
}
}
else
{
pt1.addCell(CellValue(dr[i] is DBNull ? "" : dr[i].ToString(), true, bluefont, 1, false));
}
}
}
//pt1.addCell(CellValue(@"Remark:" + System.Environment.NewLine +
// @" 1. The tooling cost base on 10k/year and the panel is 48up/set." + "\n" +
// @" 2. Assume the FPCA assembly standard follows IPC-A-610 class2." + "\n" +
// @" 3. Assume DI water cleaning process with water solution solder paste." + "\n" +
// @" 4. Assume ICT test time is 24s per unit and the tester cost is around $1400. Any change the cost must be update.", false, bluefont, 0, 7));
string remarks = "Remark:\n" + maindt.Rows[0]["Remarks"].ToString();
pt1.addCell(CellValue(remarks, false, bluefont, 0, 7));
doc.Add(pt1);
}