本文整理汇总了C#中iTextSharp.text.Table类的典型用法代码示例。如果您正苦于以下问题:C# Table类的具体用法?C# Table怎么用?C# Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Table类属于iTextSharp.text命名空间,在下文中一共展示了Table类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FillContents
protected override void FillContents() {
Table detailsTable = new Table(6, 1);
//este offset deve passar novamente para 0 caso se volte a usar Tables em vez de PdfTables
detailsTable.Offset = 3;
detailsTable.Width = 100;
detailsTable.BorderColor = iTextSharp.text.Color.LIGHT_GRAY;
detailsTable.DefaultCellBorderColor = iTextSharp.text.Color.LIGHT_GRAY;
detailsTable.Padding = 3;
detailsTable.CellsFitPage = true;
//float indentPercent = (0.0f + 5.0f) * 100f / 21.6f;
// uma página A4 tem 21.6 cm
//detailsTable.Widths = new float[] { 10, indentPercent, 19, 100 - 19 - 19 - 10 - indentPercent }; //, 19 };
detailsTable.Widths = new float[] { 20, 20, 20, 20, 20, 20 };
AddNewCell(detailsTable, "Identificador do Documento", this.BodyFont);
AddNewCell(detailsTable, "Código Referência", this.BodyFont);
AddNewCell(detailsTable, "Designação", this.BodyFont);
AddNewCell(detailsTable, "Identificador do Movimento", this.BodyFont);
AddNewCell(detailsTable, "Data de Requisição", this.BodyFont);
AddNewCell(detailsTable, "Entidade e notas", this.BodyFont);
foreach (MovimentoRule.DocumentoRequisicaoInfo doc in this.documentos) {
AddDocumentoRequisitado(detailsTable, doc);
DoRemovedEntries(1);
}
AddTable(base.mDoc, detailsTable);
}
开发者ID:aureliopires,项目名称:gisa,代码行数:30,代码来源:RelatorioDocumentosRequisitados.cs
示例2: Export
public static void Export(DetailsView dvGetStudent)
{
int rows = dvGetStudent.Rows.Count;
int columns = dvGetStudent.Rows[0].Cells.Count;
int pdfTableRows = rows;
iTextSharp.text.Table PdfTable = new iTextSharp.text.Table(2, pdfTableRows);
PdfTable.BorderWidth = 1;
PdfTable.Cellpadding = 0;
PdfTable.Cellspacing = 0;
for (int rowCounter = 0; rowCounter < rows; rowCounter++)
{
for (int columnCounter = 0; columnCounter < columns; columnCounter++)
{
string strValue = dvGetStudent.Rows[rowCounter].Cells[columnCounter].Text;
PdfTable.AddCell(strValue);
}
}
Document Doc = new Document();
PdfWriter.GetInstance(Doc, HttpContext.Current.Response.OutputStream);
Doc.Open();
Doc.Add(PdfTable);
Doc.Close();
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=StudentDetails.pdf");
HttpContext.Current.Response.End();
}
开发者ID:an-kir,项目名称:List-Of-Students,代码行数:26,代码来源:ExportToPdf.cs
示例3: ExportPDF
public static bool ExportPDF(string path)
{
try
{
// string path = "D:\\RebateForm" + confirmDetailsRow.ConfirmationID + ".pdf"; //Server.MapPath(ConfigurationManager.AppSettings["ExportPDF"] + misc.RandomString(6, true) + ".pdf");
Document document = new Document(PageSize.A4, 3, 3, 10, 10);
PdfWriter.GetInstance(document, new FileStream(path, FileMode.Create));
Phrase ph = new Phrase("All Information Deemed Accurate but not Warranted\n EQUAL HOUSING OPPERTUNITY", FontFactory.GetFont(FontFactory.HELVETICA, 10, new Color(51, 51, 51)));
HeaderFooter footer = new HeaderFooter(ph, false);
footer.Border = 0;
footer.Alignment = Element.ALIGN_CENTER;
document.Footer = footer;
document.Open();
iTextSharp.text.Table tblMain = new iTextSharp.text.Table(2);
tblMain.Border = 0;
tblMain.DefaultCellBorder = 0;
tblMain.Cellpadding = 2;
SetTitle(confirmDetailsRow, tblMain);
SetContactInfo(confirmDetailsRow, tblMain);
document.Add(tblMain);
document.Close();
return true;
}
catch (Exception)
{
//return false;
throw;
}
}
开发者ID:Terradex,项目名称:sus,代码行数:32,代码来源:RebateForm.aspx.cs
示例4: Export
public static void Export(DetailsView dvGetStudent, string imageFilePath, string filename)
{
int rows = dvGetStudent.Rows.Count;
int columns = dvGetStudent.Rows[0].Cells.Count;
int pdfTableRows = rows - 1;
iTextSharp.text.Table PdfTable = new iTextSharp.text.Table(2, pdfTableRows);
//PdfTable.BorderWidth = 1;
PdfTable.Cellpadding = 0;
PdfTable.Cellspacing = 0;
iTextSharp.text.Image jpg = iTextSharp.text.Image.GetInstance(imageFilePath);
jpg.Alignment = Element.ALIGN_CENTER;
jpg.ScaleToFit(150f, 150f);
string fontUrl = System.AppDomain.CurrentDomain.BaseDirectory + "Files\\arial.ttf";
BaseFont STF_Helvetica_Russian = BaseFont.CreateFont(fontUrl, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
Font font = new Font(STF_Helvetica_Russian, Font.DEFAULTSIZE, Font.NORMAL);
for (int rowCounter = 1; rowCounter < rows; rowCounter++)
{
for (int columnCounter = 0; columnCounter < columns; columnCounter++)
{
string strValue = dvGetStudent.Rows[rowCounter].Cells[columnCounter].Text;
PdfTable.AddCell(new Paragraph(strValue, font));
}
}
Document Doc = new Document();
PdfWriter.GetInstance(Doc, HttpContext.Current.Response.OutputStream);
Doc.Open();
Doc.Add(jpg);
Doc.Add(PdfTable);
Doc.Close();
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=" + filename + ".pdf");
HttpContext.Current.Response.End();
}
开发者ID:an-kir,项目名称:List-Of-Students,代码行数:35,代码来源:ExportToPdf.cs
示例5: CreateTable
/**
* Creates a Table object based on this TableAttributes object.
* @return a com.lowagie.text.Table object
* @throws BadElementException
*/
public Table CreateTable() {
if (content.Count == 0) throw new BadElementException("Trying to create a table without rows.");
SimpleCell rowx = (SimpleCell)content[0];
int columns = 0;
foreach (SimpleCell cell in rowx.Content) {
columns += cell.Colspan;
}
float[] widths = new float[columns];
float[] widthpercentages = new float[columns];
Table table = new Table(columns);
table.Alignment = alignment;
table.Spacing = cellspacing;
table.Padding = cellpadding;
table.CloneNonPositionParameters(this);
int pos;
foreach (SimpleCell row in content) {
pos = 0;
foreach (SimpleCell cell in row.Content) {
table.AddCell(cell.CreateCell(row));
if (cell.Colspan == 1) {
if (cell.Width > 0) widths[pos] = cell.Width;
if (cell.Widthpercentage > 0) widthpercentages[pos] = cell.Widthpercentage;
}
pos += cell.Colspan;
}
}
float sumWidths = 0f;
for (int i = 0; i < columns; i++) {
if (widths[i] == 0) {
sumWidths = 0;
break;
}
sumWidths += widths[i];
}
if (sumWidths > 0) {
table.Width = sumWidths;
table.Locked = true;
table.Widths = widths;
}
else {
for (int i = 0; i < columns; i++) {
if (widthpercentages[i] == 0) {
sumWidths = 0;
break;
}
sumWidths += widthpercentages[i];
}
if (sumWidths > 0) {
table.Widths = widthpercentages;
}
}
if (width > 0) {
table.Width = width;
table.Locked = true;
}
else if (widthpercentage > 0) {
table.Width = widthpercentage;
}
return table;
}
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:65,代码来源:SimpleTable.cs
示例6: Button1_Click
protected void Button1_Click(object sender, EventArgs e)
{
Page.Title = "Contact List";
MemoryStream PDFData = new MemoryStream();
// step 1: creation of a document-object
Document document = new Document();
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter.GetInstance(document, PDFData);
// step 3: we open the document
document.Open();
// step 4: we add a paragraph to the document
document.Add(new Paragraph(DateTime.Now.ToString()));
Contact oContact = new Contact();
DataTable dtContact = oContact.LoadAll();
int numRow = dtContact.Rows.Count;
int numCol = 5;
iTextSharp.text.Table aTable = new iTextSharp.text.Table(numCol, numRow);
aTable.AutoFillEmptyCells = true;
aTable.Padding = 1;
aTable.Spacing = 1;
Cell cell = new Cell(new Phrase("Contact List", FontFactory.GetFont(FontFactory.TIMES, 14, Font.BOLD)));
cell.Header = true;
cell.Colspan = numCol;
cell.BackgroundColor = Color.LIGHT_GRAY;
cell.HorizontalAlignment = Element.ALIGN_CENTER;
aTable.AddCell(cell);
for (int i = 0; i < dtContact.Rows.Count; i++)
{
for (int n = 1; n <= numCol; n++)
aTable.AddCell(dtContact.Rows[i][n].ToString());
}
document.Add(aTable);
// step 5: we close the document
document.Close();
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.Charset = string.Empty;
Response.Cache.SetCacheability(System.Web.HttpCacheability.Public);
Response.AddHeader("Content-Disposition",
"attachment; filename=" + Title.Replace(" ", "").Replace(":", "-") + ".pdf");
Response.OutputStream.Write(PDFData.GetBuffer(), 0, PDFData.GetBuffer().Length);
Response.OutputStream.Flush();
Response.OutputStream.Close();
Response.End();
}
开发者ID:wjkong,项目名称:MicNets,代码行数:60,代码来源:WebForm1.aspx.cs
示例7: FillContents
protected override void FillContents()
{
Table detailsTable = new Table(7, 1);
//este offset deve passar novamente para 0 caso se volte a usar Tables em vez de PdfTables
detailsTable.Offset = 3;
detailsTable.Width = 100;
detailsTable.BorderColor = iTextSharp.text.Color.LIGHT_GRAY;
detailsTable.DefaultCellBorderColor = iTextSharp.text.Color.LIGHT_GRAY;
detailsTable.Padding = 3;
detailsTable.CellsFitPage = true;
//float indentPercent = (0.0f + 5.0f) * 100f / 21.6f;
// uma página A4 tem 21.6 cm
detailsTable.Widths = new float[] { 8, 10, 15, 15, 8, 15, 100 - 8 - 10 - 15 - 15 - 8 - 15 };
AddNewCell(detailsTable, "Ident. mov.", this.BodyFont);
AddNewCell(detailsTable, "Tipo mov.", this.BodyFont);
AddNewCell(detailsTable, "Data mov.", this.BodyFont);
AddNewCell(detailsTable, "Entidade", this.BodyFont);
AddNewCell(detailsTable, "Ident. doc.", this.BodyFont);
AddNewCell(detailsTable, "Código Referência", this.BodyFont);
AddNewCell(detailsTable, "Título doc.", this.BodyFont);
foreach (Movimento mov in movimentos)
{
AddMovimento(detailsTable, mov);
DoRemovedEntries(1);
}
AddTable(base.mDoc, detailsTable);
}
开发者ID:aureliopires,项目名称:gisa,代码行数:32,代码来源:RelatorioTodosMovimentos.cs
示例8: MakeReport
// public static SimpleAttendanceList GetInstance(Selection selection,
// Rectangle pageSize,
// string reportFile) {
//
// if (instance == null)
// instance = new SimpleAttendanceList(selection, pageSize, reportFile);
// else {
// instance.selection = selection;
// instance.reportFile = reportFile;
// }
//
// if (!this.doc.IsOpen())
// this.doc.Open();
//
// return instance;
// }
public override void MakeReport()
{
// Subtitle = Event name
Chunk c = new Chunk(this.selection.Events[0].Name,
FontFactory.GetFont(FontFactory.HELVETICA, 14, Font.BOLD));
Paragraph par = new Paragraph(c);
par.Alignment = Rectangle.ALIGN_CENTER;
this.doc.Add(par);
// List
Table t = new Table(2);
t.Border = 0;
t.DefaultCellBorder = 0;
Cell cell = new Cell();
cell.HorizontalAlignment = Element.ALIGN_CENTER;
t.DefaultCell = cell; // Default cell
Font fuenteTitulo = FontFactory.GetFont(FontFactory.HELVETICA_OBLIQUE, 14, Font.UNDERLINE);
cell = new Cell();
Chunk texto = new Chunk("Nombre y Apellido", fuenteTitulo);
cell.Add(texto);
t.AddCell(cell);
cell = new Cell();
texto = new Chunk("¿Asistió?", fuenteTitulo);
cell.Add(texto);
t.AddCell(cell);
Font fuenteDatos = FontFactory.GetFont(FontFactory.HELVETICA, 10);
Font fuenteSi = FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 10);
fuenteSi.Color = Color.BLUE;
Font fuenteNo = FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 10);
fuenteNo.Color = Color.RED;
foreach (Person p in this.selection.Persons) {
cell = new Cell();
texto = new Chunk(p.Name + " " + p.Surname, fuenteDatos);
cell.Add(texto);
t.AddCell(cell);
cell = new Cell();
if (AttendancesManager.Instance.Attended(p, this.selection.Events[0]))
texto = new Chunk("Si", fuenteSi);
else
texto = new Chunk("No", fuenteNo);
cell.Add(texto);
t.AddCell(cell);
}
this.doc.Add(t);
}
开发者ID:TheProjecter,项目名称:zaspe-sharp,代码行数:74,代码来源:SimpleAttendanceList.cs
示例9: AddDocumentoRequisitado
private void AddDocumentoRequisitado(Table detailsTable, MovimentoRule.DocumentoRequisicaoInfo documento) {
AddNewCell(detailsTable, documento.idNivel.ToString(), this.ContentFont);
AddNewCell(detailsTable, documento.Codigo_Completo, this.ContentFont);
AddNewCell(detailsTable, documento.ND_Designacao, this.ContentFont);
// Identificador movimento
AddNewCell(detailsTable, documento.idMovimento.ToString(), this.ContentFont);
// Data:
AddNewCell(detailsTable, documento.data.ToString(), this.ContentFont);
// Entidade + Notas
AddNewCell(detailsTable, documento.entidade + "\n" + documento.notas, this.ContentFont);
}
开发者ID:aureliopires,项目名称:gisa,代码行数:11,代码来源:RelatorioDocumentosRequisitados.cs
示例10: AddTableInPdfDocument
public void AddTableInPdfDocument( string tableIdentifier, Table table )
{
var fieldsInTemplate = _pdfDocument.PDFFields.GetFieldPositions( tableIdentifier );
var targetContainerDetails = new TargetContainerDetails( fieldsInTemplate[0] );
var pdfContent = _pdfDocument.PDFStamper.GetOverContent( targetContainerDetails.Page );
pdfContent.CreateTemplate( targetContainerDetails.Width, targetContainerDetails.Height );
var pdfTable = GetPdfTable( targetContainerDetails.Width, table );
pdfTable.WriteSelectedRows( 0, 50, targetContainerDetails.Left, targetContainerDetails.Top, pdfContent );
}
开发者ID:BernhardPosselt,项目名称:itp-bif3,代码行数:12,代码来源:PDFFromTemplateHelper.cs
示例11: MakeReport
//
// public static SimplePersonsList GetInstance(Selection selection,
// Rectangle pageSize,
// string reportFile) {
//
// if (instance == null)
// instance = new SimplePersonsList(selection, pageSize, reportFile);
// else {
// instance.selection = selection;
// instance.reportFile = reportFile;
// }
//
// if (!this.doc.IsOpen())
// this.doc.Open();
//
// return instance;
// }
public override void MakeReport()
{
Table t = new Table(3);
t.Border = 0;
t.DefaultCellBorder = 0;
Cell cell = new Cell();
cell.HorizontalAlignment = Element.ALIGN_CENTER;
t.DefaultCell = cell; // Default cell
Font fuenteTitulo = FontFactory.GetFont(FontFactory.HELVETICA_OBLIQUE, 14, Font.UNDERLINE);
cell = new Cell();
Chunk texto = new Chunk("Apellido", fuenteTitulo);
cell.Add(texto);
t.AddCell(cell);
cell = new Cell();
texto = new Chunk("Nombre", fuenteTitulo);
cell.Add(texto);
t.AddCell(cell);
cell = new Cell();
texto = new Chunk("E-Mail", fuenteTitulo);
cell.Add(texto);
t.AddCell(cell);
Font fuenteDatos = FontFactory.GetFont(FontFactory.HELVETICA, 10);
foreach (Person p in this.selection.Persons) {
cell = new Cell();
texto = new Chunk(p.Surname, fuenteDatos);
cell.Add(texto);
t.AddCell(cell);
cell = new Cell();
texto = new Chunk(p.Name, fuenteDatos);
cell.Add(texto);
t.AddCell(cell);
cell = new Cell();
texto = new Chunk(p.EMail, fuenteDatos);
cell.Add(texto);
t.AddCell(cell);
}
this.doc.Add(t);
}
开发者ID:TheProjecter,项目名称:zaspe-sharp,代码行数:65,代码来源:SimplePersonsList.cs
示例12: write_pdf
public static void write_pdf()
{
string sFilePDF="myFile.pdf";
// step 1: creation of a document-object
Document document = new Document();
try
{
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter writer = PdfWriter.GetInstance(document,
new FileStream(sFilePDF, FileMode.Create));
// step 3: we open the document
document.Open();
// step 4: we create a table and add it to the document
Table aTable = new Table(2, 2); // 2 rows, 2 columns
aTable.AddCell("0.0");
aTable.AddCell("0.1");
aTable.AddCell("1.0");
aTable.AddCell("1.1");
document.Add(aTable);
}
catch (DocumentException de)
{
Console.WriteLine(de.ToString());
}
catch (IOException ioe)
{
Console.WriteLine(ioe.ToString());
}
// step 5: we close the document
document.Close();
}
开发者ID:evelinad,项目名称:MedLAB,代码行数:48,代码来源:PDFWriter1.cs
示例13: EscrevaProcessosNoDocumento
private void EscrevaProcessosNoDocumento()
{
Table tabela = new Table(9);
tabela.Widths = new Single[] {100, 100, 100, 100, 100, 400, 400, 90, 85};
tabela.Padding = 1;
tabela.Spacing = 0;
tabela.Width = 100;
tabela.AutoFillEmptyCells = true;
var corBackgroudHeader = new Color(211, 211, 211);
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Número do processo", _Fonte2, Cell.ALIGN_CENTER, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Data do cadastro", _Fonte2, Cell.ALIGN_CENTER, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Data do depósito", _Fonte2, Cell.ALIGN_CENTER, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Data de concessão", _Fonte2, Cell.ALIGN_CENTER, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Data da vigência", _Fonte2, Cell.ALIGN_CENTER, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Marca", _Fonte2, Cell.ALIGN_LEFT, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Cliente", _Fonte2, Cell.ALIGN_LEFT, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Despacho", _Fonte2, Cell.ALIGN_CENTER, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Ativo?", _Fonte2, Cell.ALIGN_CENTER, 0, corBackgroudHeader, true));
tabela.EndHeaders();
foreach (var processo in _processos)
{
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.Processo.ToString(), _Fonte1, Cell.ALIGN_CENTER,0, false));
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.DataDoCadastro.ToString("dd/MM/yyyy"), _Fonte1, Cell.ALIGN_CENTER, 0, false));
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.DataDoDeposito.HasValue ? processo.DataDoDeposito.Value.ToString("dd/MM/yyyy") : "", _Fonte1, Cell.ALIGN_CENTER, 0, false));
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.DataDeConcessao.HasValue ? processo.DataDeConcessao.Value.ToString("dd/MM/yyyy") : "", _Fonte1, Cell.ALIGN_CENTER, 0, false));
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.DataDaVigencia.HasValue ? processo.DataDaVigencia.Value.ToString("dd/MM/yyyy") : "", _Fonte1, Cell.ALIGN_CENTER, 0, false));
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.Marca.DescricaoDaMarca, _Fonte1, Cell.ALIGN_LEFT,0 , false));
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.Marca.Cliente.Pessoa.Nome, _Fonte1, Cell.ALIGN_LEFT, 0, false));
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.Despacho != null ? processo.Despacho.CodigoDespacho.ToString() : "", _Fonte1, Cell.ALIGN_CENTER, 0, false));
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.Ativo ? "SIM" : "NÃO", _Fonte1, Cell.ALIGN_CENTER, 0, false));
}
_documento.Add(tabela);
// Chunk linhaQuantidadeDeItens = new Chunk(String.Concat("Quantidade de processos de marcas : ", _processos.Count), _Fonte4);
// _documento.Add(linhaQuantidadeDeItens);
}
开发者ID:ViniciusConsultor,项目名称:petsys,代码行数:43,代码来源:GeradorDeRelatorioDeProcessosDeMarcas.cs
示例14: EscrevaProcessosNoDocumentoAnalitico
private void EscrevaProcessosNoDocumentoAnalitico()
{
var tabela = new Table(1);
tabela.Widths = new Single[] { 218 };
tabela.Padding = 0;
tabela.Spacing = 0;
tabela.Width = 100;
tabela.AutoFillEmptyCells = true;
tabela.DefaultCell.Border = Rectangle.NO_BORDER;
tabela.EndHeaders();
foreach (var revistaDePatente in _revistasPatentes)
{
var tabela1 = new Table(1);
tabela1.Widths = new Single[] { 100 };
tabela1.Padding = 0;
tabela1.Spacing = 0;
tabela1.Width = 100;
tabela1.AutoFillEmptyCells = true;
tabela1.Border = 0;
tabela1.EndHeaders();
tabela1.DefaultCell.Border = Rectangle.NO_BORDER;
var tabelaProcesso = new Cell(ObtenhaTabelaCelulaProcesso(revistaDePatente));
tabela1.AddCell(tabelaProcesso);
var tabelaRevistas = new Cell(ObtenhaTabelaInformacoesRevista(revistaDePatente));
tabela1.AddCell(tabelaRevistas);
tabela.AddCell(new Cell(tabela1));
tabela.AddCell(ObtenhaCelulaVazia());
tabela.AddCell(ObtenhaCelulaVazia());
tabela.AddCell(ObtenhaCelulaVazia());
}
_documento.Add(tabela);
}
开发者ID:ViniciusConsultor,项目名称:petsys,代码行数:40,代码来源:GeradorDeRelatorioDePublicacoesDasPatentes.cs.cs
示例15: OnStartPage
public void OnStartPage(PdfWriter writer, Document document)
{
var pessoaJuridica = empresa.Pessoa as IPessoaJuridica;
Chunk imagem;
if (!string.IsNullOrEmpty(pessoaJuridica.Logomarca))
{
var imghead = iTextSharp.text.Image.GetInstance(HttpContext.Current.Server.MapPath(pessoaJuridica.Logomarca));
imagem = new Chunk(imghead, 0, 0);
}
else
imagem = new Chunk("");
var dadosEmpresa = new Phrase();
dadosEmpresa.Add(pessoaJuridica.NomeFantasia + Environment.NewLine);
if (pessoaJuridica.Enderecos.Count > 0)
{
var endereco = pessoaJuridica.Enderecos[0];
dadosEmpresa.Add(endereco.ToString());
}
if (pessoaJuridica.Telefones.Count > 0)
{
var telefone = pessoaJuridica.Telefones[0];
dadosEmpresa.Add("Telefone " + telefone);
}
var tabelaHeader = new Table(2);
tabelaHeader.Border = 0;
tabelaHeader.Width = 100;
var cell = new Cell(new Phrase(imagem));
cell.Border = 0;
cell.Width = 30;
tabelaHeader.AddCell(cell);
var cell1 = new Cell(dadosEmpresa);
cell1.Border = 0;
cell1.Width = 70;
tabelaHeader.AddCell(cell1);
var linhaVazia = new Cell(new Phrase("\n", font2));
linhaVazia.Colspan = 2;
linhaVazia.DisableBorderSide(1);
tabelaHeader.AddCell(linhaVazia);
document.Add(tabelaHeader);
// Adicionando linha que informa o número da revista
var tabelaNumeroDaRevista = new Table(1);
tabelaNumeroDaRevista.Border = 0;
tabelaNumeroDaRevista.Width = 100;
var celulaNumeroDaRevista = new Cell(new Phrase("Processos de clientes publicados na revista de marcas: " + _numeroDaRevistaSelecionada, font3));
celulaNumeroDaRevista.Border = 0;
celulaNumeroDaRevista.Width = 70;
celulaNumeroDaRevista.Colspan = 1;
tabelaNumeroDaRevista.AddCell(celulaNumeroDaRevista);
var linhaVaziaNumeroRevista = new Cell(new Phrase("\n", font2));
linhaVaziaNumeroRevista.Border = 0;
linhaVaziaNumeroRevista.Width = 70;
linhaVaziaNumeroRevista.Colspan = 1;
linhaVaziaNumeroRevista.DisableBorderSide(1);
tabelaNumeroDaRevista.AddCell(linhaVaziaNumeroRevista);
document.Add(tabelaNumeroDaRevista);
}
开发者ID:ViniciusConsultor,项目名称:petsys,代码行数:76,代码来源:GeradorDeRelatorioDeProcessosDeMarcasPublicacoesProprias.cs
示例16: EscrevaProcessosNoDocumentoSintetico
private void EscrevaProcessosNoDocumentoSintetico()
{
var tabela = new Table(4);
tabela.Widths = new Single[] { 60, 100, 60, 100 };
tabela.Padding = 1;
tabela.Spacing = 0;
tabela.Width = 100;
tabela.AutoFillEmptyCells = true;
var corBackgroudHeader = new Color(211, 211, 211);
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Número do processo", _Fonte2, Cell.ALIGN_CENTER, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Marca", _Fonte2, Cell.ALIGN_LEFT, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Despacho", _Fonte2, Cell.ALIGN_CENTER, 0, corBackgroudHeader, true));
tabela.AddCell(iTextSharpUtilidades.CrieCelula("Cliente", _Fonte2, Cell.ALIGN_LEFT, 0, corBackgroudHeader, true));
tabela.EndHeaders();
foreach (var processo in _processos)
{
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.Processo.ToString(), _Fonte1, Cell.ALIGN_CENTER, 0, false));
if (processo.Marca != null && !string.IsNullOrEmpty(processo.Marca.DescricaoDaMarca))
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.Marca.DescricaoDaMarca, _Fonte1, Cell.ALIGN_LEFT, 0, false));
else
tabela.AddCell(iTextSharpUtilidades.CrieCelula(string.Empty, _Fonte1, Cell.ALIGN_LEFT, 0, false));
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.Despacho != null ? processo.Despacho.CodigoDespacho : "", _Fonte1, Cell.ALIGN_CENTER, 0, false));
tabela.AddCell(iTextSharpUtilidades.CrieCelula(processo.Marca.Cliente.Pessoa.Nome, _Fonte1, Cell.ALIGN_LEFT, 0, false));
}
_documento.Add(tabela);
}
开发者ID:ViniciusConsultor,项目名称:petsys,代码行数:36,代码来源:GeradorDeRelatorioDeProcessosDeMarcasPublicacoesProprias.cs
示例17: PYU960326AG7
public static void PYU960326AG7(Document document, ElectronicDocument electronicDocument, Data objTimbre, pdfPageEventHandlerPfizer pageEventHandler, DataTable dtEncabezado, DataTable dtDetalle, Hashtable htCFDI, HttpContext hc)
{
try
{
//DAL dal = new DAL();
#region "Construimos el Documento"
#region "Construimos el Encabezado"
Table encabezado = new Table(7);
float[] headerwidthsEncabezado = { 9, 18, 28, 28, 5, 7, 5 };
encabezado.Widths = headerwidthsEncabezado;
encabezado.WidthPercentage = 100;
encabezado.Padding = 1;
encabezado.Spacing = 1;
encabezado.BorderWidth = 0;
encabezado.DefaultCellBorder = 0;
encabezado.BorderColor = gris;
Image imgLogo = Image.GetInstance(pathIMGLOGO);
imgLogo.ScalePercent(47f);
par = new Paragraph();
par.KeepTogether = true;
par.SetLeading(1f, 1f);
par.Add(new Chunk(imgLogo, 0, 0));
par.Add(new Chunk("", f6));
cel = new Cell(par);
cel.BorderWidthTop = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthRight = 0;
cel.BorderWidthBottom = 0;
cel.Rowspan = 5;
cel.Colspan = 2;
encabezado.AddCell(cel);
par = new Paragraph();
par.KeepTogether = true;
par.SetLeading(8f, 9f);
par.Add(new Chunk(htCFDI["nombreEmisor"].ToString().ToUpper(), f6B));
par.Add(new Chunk("\nRFC " + htCFDI["rfcEmisor"].ToString().ToUpper(), f6));
par.Add(new Chunk("\n" + htCFDI["direccionEmisor1"].ToString().ToUpper(), f6));
par.Add(new Chunk("\n" + htCFDI["direccionEmisor2"].ToString().ToUpper(), f6));
par.Add(new Chunk("\n" + htCFDI["direccionEmisor3"].ToString().ToUpper(), f6));
par.Add(new Chunk("\nTel. (52) 55 5081-8500", f6));
cel = new Cell(par);
cel.BorderWidthTop = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthRight = 0;
cel.BorderWidthBottom = 0;
cel.Rowspan = 5;
encabezado.AddCell(cel);
StringBuilder expedido = new StringBuilder();
expedido.
Append("Lugar de Expedición México DF\n").
Append(htCFDI["sucursal"]).Append("\n").
Append(htCFDI["direccionExpedido1"].ToString().ToUpper()).Append("\n").
Append(htCFDI["direccionExpedido2"].ToString().ToUpper()).Append("\n").
Append(htCFDI["direccionExpedido3"].ToString().ToUpper()).Append("\n");
cel = new Cell(new Phrase(expedido.ToString(), f6));
cel.VerticalAlignment = Element.ALIGN_MIDDLE;
cel.BorderColor = gris;
cel.BorderWidthTop = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthRight = (float).5;
cel.BorderWidthBottom = 0;
cel.Rowspan = 4;
encabezado.AddCell(cel);
cel = new Cell(new Phrase(htCFDI["tipoDoc"].ToString(), titulo));
cel.VerticalAlignment = Element.ALIGN_MIDDLE;
cel.HorizontalAlignment = Element.ALIGN_CENTER;
cel.BackgroundColor = azul;
cel.BorderWidthTop = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthRight = 0;
cel.BorderWidthBottom = 0;
cel.BorderColor = gris;
cel.Colspan = 3;
encabezado.AddCell(cel);
cel = new Cell(new Phrase(htCFDI["serie"].ToString().ToUpper() + electronicDocument.Data.Folio.Value, f6B));
cel.VerticalAlignment = Element.ALIGN_MIDDLE;
cel.HorizontalAlignment = Element.ALIGN_CENTER;
cel.BorderWidthTop = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthRight = (float).5;
cel.BorderWidthBottom = (float).5;
cel.BorderColor = gris;
cel.Colspan = 3;
encabezado.AddCell(cel);
cel = new Cell(new Phrase("Día", f6B));
cel.VerticalAlignment = Element.ALIGN_MIDDLE;
cel.HorizontalAlignment = Element.ALIGN_CENTER;
cel.BorderWidthTop = 0;
cel.BorderWidthLeft = 0;
//.........这里部分代码省略.........
开发者ID:Bloodrider,项目名称:wsFacturizate,代码行数:101,代码来源:PFI730206632.cs
示例18: formatoN
public static void formatoN(Document document, ElectronicDocument electronicDocument, Data objTimbre, pdfPageEventHandlerPfizer pageEventHandler, DataTable dtEncabezado, DataTable dtDetalle, Hashtable htCFDI, HttpContext hc)
{
try
{
DAL dal = new DAL();
#region "Construimos el Documento"
#region "Construimos el Encabezado"
Table encabezado = new Table(7);
float[] headerwidthsEncabezado = { 9, 18, 28, 28, 5, 7, 5 };
encabezado.Widths = headerwidthsEncabezado;
encabezado.WidthPercentage = 100;
encabezado.Padding = 1;
encabezado.Spacing = 1;
encabezado.BorderWidth = 0;
encabezado.DefaultCellBorder = 0;
encabezado.BorderColor = gris;
//Agregando Imagen de Logotipo
Image imgLogo = Image.GetInstance(pathIMGLOGO);
imgLogo.ScalePercent(47f);
par = new Paragraph();
par.KeepTogether = true;
par.SetLeading(1f, 1f);
par.Add(new Chunk(imgLogo, 0, 0));
par.Add(new Chunk("", f6));
cel = new Cell(par);
cel.BorderWidthTop = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthRight = 0;
cel.BorderWidthBottom = 0;
cel.Rowspan = 5;
cel.Colspan = 2;
encabezado.AddCell(cel);
par = new Paragraph();
par.KeepTogether = true;
par.SetLeading(8f, 9f);
par.Add(new Chunk(htCFDI["nombreEmisor"].ToString().ToUpper(), f6B));
par.Add(new Chunk("\nRFC " + htCFDI["rfcEmisor"].ToString().ToUpper(), f6));
par.Add(new Chunk("\n" + htCFDI["direccionEmisor1"].ToString().ToUpper(), f6));
par.Add(new Chunk("\n" + htCFDI["direccionEmisor2"].ToString().ToUpper(), f6));
par.Add(new Chunk("\n" + htCFDI["direccionEmisor3"].ToString().ToUpper(), f6));
par.Add(new Chunk("\nTel. (52) 55 5081-8500", f6));
cel = new Cell(par);
cel.BorderWidthTop = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthRight = 0;
cel.BorderWidthBottom = 0;
cel.Rowspan = 5;
encabezado.AddCell(cel);
StringBuilder expedido = new StringBuilder();
expedido.
Append("Lugar de Expedición México DF\n").
Append(htCFDI["sucursal"]).Append("\n").
Append(htCFDI["direccionExpedido1"].ToString().ToUpper()).Append("\n").
Append(htCFDI["direccionExpedido2"].ToString().ToUpper()).Append("\n").
Append(htCFDI["direccionExpedido3"].ToString().ToUpper()).Append("\n").
Append(dtEncabezado.Rows[0]["corporateCode"]).Append("\n").//CE29
Append(dtEncabezado.Rows[0]["oldCorporateCode"].ToString()).Append("\n");//CE30;
cel = new Cell(new Phrase(expedido.ToString(), f6));
cel.VerticalAlignment = Element.ALIGN_MIDDLE;
cel.BorderColor = gris;
cel.BorderWidthTop = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthRight = (float).5;
cel.BorderWidthBottom = 0;
cel.Rowspan = 5;
encabezado.AddCell(cel);
cel = new Cell(new Phrase(htCFDI["tipoDoc"].ToString(), titulo));
cel.VerticalAlignment = Element.ALIGN_MIDDLE;
cel.HorizontalAlignment = Element.ALIGN_CENTER;
cel.BackgroundColor = azul;
cel.BorderWidthTop = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthRight = 0;
cel.BorderWidthBottom = 0;
cel.BorderColor = gris;
cel.Colspan = 3;
encabezado.AddCell(cel);
cel = new Cell(new Phra
|
请发表评论