168 lines
7.2 KiB
C#
168 lines
7.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using ceTe.DynamicPDF.Text;
|
|
using System.Collections;
|
|
using ceTe.DynamicPDF;
|
|
using PDFGenerator.Presentation.Section.Tables;
|
|
using PDFGenerator.Presentation.Section.Charts;
|
|
using PDFGenerator.BusinessLayer.DataSection;
|
|
using System.Data;
|
|
using PDFGenerator.BusinessLayer;
|
|
using ceTe.DynamicPDF.PageElements;
|
|
|
|
namespace PDFGenerator.Presentation.Section
|
|
{
|
|
|
|
|
|
|
|
public class S175 : STorta //: ISezione
|
|
{
|
|
|
|
|
|
#region ISezione Members
|
|
|
|
|
|
|
|
public new void writeSezione(DataThread dataThread)
|
|
{
|
|
|
|
float dim = 0;
|
|
|
|
DocumentPDF document = dataThread.DocumentPDF;
|
|
DataSetS175 set = (DataSetS175)dataThread.Data.DatiSezione;
|
|
|
|
//if (dataThread.TipoContratto != TipoContratto.Private)
|
|
// document.addPage();
|
|
|
|
document.setSezTitolo(dataThread.SezioneReport.Titolo);
|
|
|
|
string Contratto = set.Tables["Prodotto"].Rows[0]["Contratto"].ToString();
|
|
string Prodotto = set.Tables["Prodotto"].Rows[0]["DescrizioneProdotto"].ToString();
|
|
|
|
string testoIntroduttivo = dataThread.SezioneReport.TestoIntroduttivo.Replace("$/Prodotto/$", Prodotto).Replace("$/Contratto/$", Contratto);
|
|
|
|
document.setChapterHeader(testoIntroduttivo, 0, 520, 8);
|
|
|
|
float Xtable = document.getMargineLeft();
|
|
float Ytable = document.getLastPos();
|
|
|
|
int dFont = 8;
|
|
int hRow = 30;
|
|
int wCol1 = 150;
|
|
int wCol2 = 70;
|
|
// int wCol3 = 65;
|
|
int hGrafico = 150;
|
|
float lastPosGrafico = Ytable + hGrafico;
|
|
|
|
Tabella tab = new Tabella();
|
|
|
|
DatiTabella datitabControvaloreRiferimento = new DatiTabella();
|
|
datitabControvaloreRiferimento.table = set.Tables["ControvaloreRiferimento"];
|
|
|
|
datitabControvaloreRiferimento.setY(document.getLastPos() + dim);
|
|
datitabControvaloreRiferimento.setX(document.getMargineLeft() + 10);
|
|
datitab.setHeaderDim(hRow);
|
|
datitab.SetRowDim(hRow);
|
|
datitabControvaloreRiferimento.setCellSpace(0);
|
|
datitabControvaloreRiferimento.setIsLinee(2);
|
|
datitabControvaloreRiferimento.setCell(wCol1, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdanaB, true, dFont);
|
|
datitabControvaloreRiferimento.setCell(wCol2, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdanaB, false, dFont);
|
|
|
|
document.InsertTable(tab.getTabella(datitabControvaloreRiferimento));
|
|
|
|
dim += datitab.GetRowDim() * datitabControvaloreRiferimento.getNumRow();
|
|
|
|
DatiTabella datitabComponentePerformance = new DatiTabella();
|
|
datitabComponentePerformance.table = set.Tables["ComponentePerformance"];
|
|
|
|
datitabComponentePerformance.setY(document.getLastPos() + dim);
|
|
datitabComponentePerformance.setX(document.getMargineLeft() + 10);
|
|
datitabComponentePerformance.setIsRet();
|
|
datitab.setHeaderDim(hRow);
|
|
datitab.SetRowDim(hRow);
|
|
datitabComponentePerformance.setCellSpace(0);
|
|
datitabComponentePerformance.setIsLinee(2);
|
|
datitabComponentePerformance.setCell(wCol1, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdana, false, dFont);
|
|
datitabComponentePerformance.setCell(wCol2, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false, dFont);
|
|
|
|
document.InsertTable(tab.getTabella(datitabComponentePerformance));
|
|
|
|
dim += datitab.GetRowDim() * datitabComponentePerformance.getNumRow();
|
|
|
|
DatiTabella datitabComponenteProtezione = new DatiTabella();
|
|
datitabComponenteProtezione.table = set.Tables["ComponenteProtezione"];
|
|
datitabComponenteProtezione.setY(document.getLastPos() + dim);
|
|
datitabComponenteProtezione.setX(document.getMargineLeft() + 10);
|
|
datitabComponenteProtezione.setIsRet();
|
|
datitab.setHeaderDim(hRow);
|
|
datitab.SetRowDim(hRow);
|
|
datitabComponenteProtezione.setCellSpace(0);
|
|
datitabComponenteProtezione.setIsLinee(2);
|
|
datitabComponenteProtezione.setCell(wCol1, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdana, false, dFont);
|
|
datitabComponenteProtezione.setCell(wCol2, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false, dFont);
|
|
|
|
document.InsertTable(tab.getTabella(datitabComponenteProtezione));
|
|
|
|
dim += datitab.GetRowDim() * datitabComponenteProtezione.getNumRow();
|
|
|
|
DatiTabella datitabControvaloreProtetto = new DatiTabella();
|
|
datitabControvaloreProtetto.table = set.Tables["ControvaloreProtetto"];
|
|
|
|
datitabControvaloreProtetto.setY(document.getLastPos() + dim);
|
|
datitabControvaloreProtetto.setX(document.getMargineLeft() + 10);
|
|
datitab.setHeaderDim(hRow);
|
|
datitab.SetRowDim(hRow);
|
|
datitabControvaloreProtetto.setCellSpace(0);
|
|
datitabControvaloreProtetto.setIsLinee(2);
|
|
datitabControvaloreProtetto.setCell(wCol1, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdanaB, true, dFont);
|
|
datitabControvaloreProtetto.setCell(wCol2, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdanaB, false, dFont);
|
|
|
|
document.InsertTable(tab.getTabella(datitabControvaloreProtetto));
|
|
|
|
dim += datitab.GetRowDim() * datitabControvaloreProtetto.getNumRow();
|
|
|
|
DatiTabella datitabDataRiferimento = new DatiTabella();
|
|
datitabDataRiferimento.table = set.Tables["DataRiferimento"];
|
|
|
|
datitabDataRiferimento.setY(document.getLastPos() + dim);
|
|
datitabDataRiferimento.setX(document.getMargineLeft() + 10);
|
|
datitab.setHeaderDim(hRow);
|
|
datitab.SetRowDim(hRow);
|
|
datitabDataRiferimento.setCellSpace(0);
|
|
datitabDataRiferimento.setIsLinee(2);
|
|
datitabDataRiferimento.setCell(wCol1, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdanaB, true, dFont);
|
|
datitabDataRiferimento.setCell(wCol2, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdanaB, false, dFont);
|
|
|
|
document.InsertTable(tab.getTabella(datitabDataRiferimento));
|
|
|
|
dim += datitab.GetRowDim() * datitabDataRiferimento.getNumRow();
|
|
|
|
#region GRAFICO
|
|
DatiGrafico dati = new DatiGrafico();
|
|
dati.dataTab = set.ChartData;
|
|
dati.setHeight(hGrafico);
|
|
dati.setWidth(hGrafico);
|
|
TortaS175 isto = new TortaS175();
|
|
document.InsertGrafico(isto.getGrafico(dati), 270, Ytable - 20, 400);
|
|
#endregion
|
|
|
|
Ytable = lastPosGrafico - 15;
|
|
|
|
document.setLastPos(hGrafico - 10);
|
|
|
|
string nota = dataThread.SezioneReport.Nota;
|
|
if (!string.IsNullOrEmpty(nota))
|
|
document.setChapterHeader(nota, 0, 520, 7);
|
|
|
|
string nota1 = dataThread.SezioneReport.NotaAlternativa;
|
|
if (!string.IsNullOrEmpty(nota))
|
|
document.setChapterHeader(nota1, 0, 520, 7);
|
|
|
|
//document.setLastPos(10);
|
|
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |