107 lines
4.3 KiB
C#
107 lines
4.3 KiB
C#
using System;
|
|
using System.Data;
|
|
using System.Configuration;
|
|
using System.Web;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Web.UI.WebControls.WebParts;
|
|
using System.Web.UI.HtmlControls;
|
|
using System.Collections;
|
|
using ceTe.DynamicPDF;
|
|
using ceTe.DynamicPDF.Text;
|
|
using PDFGenerator.Presentation.Section.Tables;
|
|
using PDFGenerator.BusinessLayer.DataSection;
|
|
using PDFGenerator.BusinessLayer;
|
|
|
|
namespace PDFGenerator.Presentation.Section
|
|
{
|
|
public class S51 : ISezione
|
|
{
|
|
|
|
DataThread dsParam = null;
|
|
|
|
public S51 ()
|
|
{
|
|
//
|
|
// TODO: Add constructor logic here
|
|
//
|
|
}
|
|
|
|
#region ISezione Members
|
|
|
|
public void writeSezione (DataThread dataThread)
|
|
{
|
|
DocumentPDF document = dataThread.DocumentPDF;
|
|
|
|
DatiTabella datitab = new DatiTabella();
|
|
DataSetS51 set = (DataSetS51)dataThread.Data.DatiSezione;
|
|
datitab.table = set.Tables["ContoCorrente"];
|
|
dsParam = dataThread;
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * (datitab.getNumRow() + 3)))
|
|
document.addPage();
|
|
|
|
datitab.setY(document.getLastPos());
|
|
datitab.setIsLinee(1);
|
|
datitab.setHeader();
|
|
datitab.setHeaderFont(8);
|
|
//if (dataThread.Intermediario == "") {
|
|
if (dataThread.NumeroIntermediari > 1)
|
|
{
|
|
datitab.setCell(130, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdana, false, 7);
|
|
datitab.setCell(180, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdana, false, 7);
|
|
datitab.setCell(88, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false, 7);
|
|
datitab.setCell(50, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false, 7);
|
|
datitab.setCell(65, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false, 7);
|
|
}
|
|
else
|
|
{
|
|
datitab.table.Columns.Remove(datitab.table.Columns["Intermediario"]);
|
|
datitab.setCell(270, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdana, false, 7);
|
|
datitab.setCell(128, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false, 7);
|
|
datitab.setCell(50, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false, 7);
|
|
datitab.setCell(65, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false, 7);
|
|
}
|
|
|
|
//eventuali operazioni sul dataset
|
|
//calcola se entra nella pagina altrimenti aggiunge una nuova pagina.
|
|
if (document.checkMargin(datitab.GetRowDim() * (datitab.getNumRow() + 2)))
|
|
document.addPage();
|
|
|
|
//aggiorna l'indice
|
|
document.setTitolo(dataThread.SezioneReport.Titolo);
|
|
//document.page.Elements.Add(new ceTe.DynamicPDF.PageElements.Label(s, xMacroAsset + width, yLabel, (float)Convert.ToDouble(dati.campi[i]), heightLabel, (ceTe.DynamicPDF.Font)dati.font[i], fontSize, (ceTe.DynamicPDF.TextAlign)dati.align[i], ceTe.DynamicPDF.CmykColor.Black));
|
|
|
|
datitab.setY(document.getLastPos());
|
|
datitab.setX(document.getMargineLeft());
|
|
datitab.setCellSpace(0);
|
|
Tabella tab = new Tabella();
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tab.HeaderFont = 8;
|
|
//setta posizione tabella
|
|
document.InsertTable(tab.getTabella(datitab));
|
|
|
|
float dim = datitab.GetRowDim() * (datitab.getNumRow() + 1);
|
|
datitab = new DatiTabella();
|
|
datitab.table = set.Tables["TotaleConti"];
|
|
|
|
datitab.setY(document.getLastPos() + dim);
|
|
datitab.setX(document.getMargineLeft());
|
|
datitab.setCell(278, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdanaB, true);
|
|
datitab.setCell(120, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdanaB, true);
|
|
datitab.setCell(115, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdanaB, true);
|
|
|
|
|
|
|
|
document.InsertTable(tab.getTabella(datitab));
|
|
|
|
///// setto la posizione aggiornata
|
|
document.setLastPos(datitab.GetRowDim() + dim);
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
}
|
|
}
|