2025-04-15 12:10:19 +02:00

85 lines
3.4 KiB
C#
Raw Blame History

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 S27 : ISezione {
public S27() {
//
// TODO: Add constructor logic here
//
}
#region ISezione Members
public void writeSezione(DataThread dataThread) {
DocumentPDF document = dataThread.DocumentPDF;
DatiTabella datitab = new DatiTabella();
DataSetS27 set = (DataSetS27)dataThread.Data.DatiSezione;
datitab.table = set.Tables["Patrimonio"];
datitab.setY(document.getLastPos());
datitab.setIsLinee(1);
datitab.setHeader();
datitab.setCell(140, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdana, false);
datitab.setCell(170, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false);
datitab.setCell(200, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false);
//eventuali operazioni sul dataset
//calcola se entra nella pagina altrimenti aggiunge una nuova pagina.
//if (document.checkMargin(datitab.GetRowDim() * (datitab.getNumRow() + 2))) document.addPage();
if (document.checkMargin(130))
document.addPage();
//aggiorna l'indice
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI")
document.setSezTitoloDiagnosi(dataThread.SezioneReport.Titolo);
else
document.setSezTitolo(dataThread.SezioneReport.Titolo);
document.setSezHeader("Di seguito si riportano i dati relativi alle ulteriori propriet<65> che concorrono a determinare il suo patrimonio.");
//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["TotalePatrimonio"];
datitab.setY(document.getLastPos() + dim);
datitab.setX(document.getMargineLeft());
datitab.setCell(420, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdanaB, true);
datitab.setCell(90, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdanaB, true);
document.InsertTable(tab.getTabella(datitab));
///// setto la posizione aggiornata
document.setLastPos(datitab.GetRowDim() + dim);
}
#endregion
}
}