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

112 lines
3.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
using PDFGenerator.Presentation.Section.Tables;
using PDFGenerator.BusinessLayer.DataSection;
using PDFGenerator.BusinessLayer;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.Text;
/// <summary>
/// Summary description for S103
/// </summary>
///
namespace PDFGenerator.Presentation.Section
{
public class S131 : ISezione
{
private string _titolo = string.Empty;
private string _testointroduttivo = string.Empty;
/// <summary>
/// Titolo della sezione
/// </summary>
public string Titolo
{
get
{
return _titolo;
}
set
{
_titolo = value;
}
}
/// <summary>
/// Testo introduttivo della Sezione.
/// </summary>
public string TestoIntroduttivo
{
get
{
return _testointroduttivo;
}
set
{
_testointroduttivo = value;
}
}
public S131()
{
//
// TODO: Add constructor logic here
//
}
public void writeSezione(DataThread dataThread)
{
DocumentPDF document = dataThread.DocumentPDF;
DataSetS131 set = (DataSetS131)dataThread.Data.DatiSezione;
document.setSezTitolo(dataThread.SezioneReport.Titolo);
document.setChapterHeader(dataThread.SezioneReport.TestoIntroduttivo, 0, 520, 8);
float YTable = document.getLastPos();
float XTable = document.getMargineLeft();
DatiTabella datitab = new DatiTabella();
datitab.table = set.Tables["Prodotti"];
datitab.SetRowDim(15);
Tabella tabellaDati = new Tabella(XTable, YTable);
tabellaDati.Header = true;
tabellaDati.AltezzaCella = 15;
tabellaDati.Datasource = datitab.table;
tabellaDati.Colonne.Add(new Colonna("Prodotto", "Prodotto", 242, TipoAllineamento.SINISTRA, false, 9, false));
tabellaDati.Colonne.Add(new Colonna("Controvalore", "Controvalore (€)", 85, TipoAllineamento.DESTRA, false, 9, false));
tabellaDati.Colonne.Add(new Colonna("RischioMercato", "Rischio Mercato (VAR %)", 100, TipoAllineamento.DESTRA, false, 9, false));
tabellaDati.Colonne.Add(new Colonna("RischioRelativo", "Rischio Relativo (%)", 85, TipoAllineamento.DESTRA, false, 9, false));
tabellaDati.Draw(datitab, document);
bool notaNeeded = false;
if (notaNeeded)
document.getCurrentPage().Elements.Add(new Label(Resource.Nota_TabellaEmittenti, XTable, YTable + tabellaDati.AltezzaTabella, 500F, 30F, Globals.OpenTypeFontVerdana, 8));
document.addPage();
}
}
}