本文整理匯總了C#中iTextSharp.text.pdf.PdfPTable.setWidths方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfPTable.setWidths方法的具體用法?C# PdfPTable.setWidths怎麽用?C# PdfPTable.setWidths使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfPTable
的用法示例。
在下文中一共展示了PdfPTable.setWidths方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: 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") != "")
//.........這裏部分代碼省略.........
示例2: 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);
}
示例3: 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);
}
示例4: 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;
}
}
示例5: 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);
}
示例6: 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);
}