619 lines
30 KiB
C#
619 lines
30 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;
|
|
using ContrattoSei.Utilities;
|
|
using ceTe.DynamicPDF.PageElements;
|
|
using System.Collections.Generic;
|
|
|
|
namespace PDFGenerator.Presentation.Section
|
|
{
|
|
class S180 : ISezione
|
|
{
|
|
|
|
|
|
private string _header = "";
|
|
|
|
public string Header
|
|
{
|
|
get { return _header; }
|
|
set { _header = value; }
|
|
}
|
|
|
|
|
|
private TipoReport _tipologiaReport;
|
|
public TipoReport TipologiaReport
|
|
{
|
|
get { return _tipologiaReport; }
|
|
set { _tipologiaReport = value; }
|
|
}
|
|
|
|
private string _testoIntroduttivo = string.Empty;
|
|
public string TestoIntroduttivo
|
|
{
|
|
get { return _testoIntroduttivo; }
|
|
set { _testoIntroduttivo = value; }
|
|
}
|
|
|
|
private string _testoChiusura = string.Empty;
|
|
public string TestoChiusura
|
|
{
|
|
get { return _testoChiusura; }
|
|
set { _testoChiusura = value; }
|
|
}
|
|
|
|
|
|
public S180()
|
|
{
|
|
//
|
|
// TODO: Add constructor logic here
|
|
//
|
|
}
|
|
|
|
#region ISezione Members
|
|
|
|
#region ATTENZIONE NON PIU VALIDA
|
|
public void writeSezione(DataThread dataThread)
|
|
{
|
|
|
|
DocumentPDF document = dataThread.DocumentPDF;
|
|
DataSetS180 set = (DataSetS180)dataThread.Data.DatiSezione;
|
|
|
|
|
|
|
|
//20180820 CR Professionali: la tabella non va visualizzata per i clienti professionali
|
|
if (!dataThread.IsProffesionalClient)
|
|
{
|
|
|
|
if (set.Tables["ProdottiAltaComplessita"].Rows.Count > 0)
|
|
{
|
|
//20180913 Commentato blocco (eventualmente, si dovrebbe mettere come ramo ELSE nel prossimo blocco if
|
|
//20180817 Se non c'è spazio nella pagina corrente
|
|
//if (!document.checkMargin(400))
|
|
//{
|
|
// document.changePage();
|
|
// document.nextPage(document.getMargineLeft());
|
|
// //document.addPage();
|
|
|
|
//}
|
|
//--20180817
|
|
//--20180913
|
|
|
|
// 20181219 Fix bug di spaginazione della tabella complessità alta, in caso venga stampata a cavallo di due pagine
|
|
if (!document.LastSectionCheckIn.Equals("S179")) // Se non si è passati per la S179
|
|
{
|
|
document.changePage();
|
|
document.nextPage(document.getMargineLeft());
|
|
}
|
|
else
|
|
{
|
|
if (document.getLastPos() >= 500)
|
|
{
|
|
document.changePage();
|
|
document.nextPage(document.getMargineLeft());
|
|
}
|
|
}
|
|
//MIFID2 20180522 DA MODIFICARE INTRODUCENDO UNA NUOVA PROPRIETA' in DocumentPDF (LastSectionPrinted) sulla quale si fa il controllo se è stata stampata o meno...
|
|
//if (document.getLastPos() > 700)
|
|
//if (!document.LastSectionCheckIn.Equals("S179")) // Se non si è passati per la S179
|
|
//{
|
|
// document.changePage();
|
|
// document.nextPage(document.getMargineLeft());
|
|
//}
|
|
//--MIFID2
|
|
//--20181219
|
|
|
|
ceTe.DynamicPDF.Merger.ImportedPage page = document.getCurrentPage();
|
|
|
|
document.setSezTitoloDiagnosi(dataThread.SezioneReport.Titolo);
|
|
|
|
string nota1 = dataThread.SezioneReport.Nota;
|
|
string nota2 = dataThread.SezioneReport.NotaAlternativa;
|
|
|
|
string tempTesto = dataThread.SezioneReport.TestoIntroduttivo;
|
|
|
|
document.setChapterHeader(tempTesto.Replace("$/Banca/$", dataThread.NomeRete).Replace("Sanpaolo Invest", "Fideuram S.p.A., commercializzato tramite la rete di private banker Sanpaolo Invest"), 0, 520, 8);
|
|
|
|
document.setHeaderSpace(5);
|
|
|
|
DatiTabella datitab = new DatiTabella();
|
|
|
|
#region Tabella Dettaglio Prodotti
|
|
Tabella tab = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tab.HeaderFont = 8;
|
|
tab.Header = true;
|
|
tab.LineaFineTabella = false;
|
|
tab.Datasource = datitab.table;
|
|
|
|
datitab.table = set.Tables["ProdottiAltaComplessita"];
|
|
|
|
datitab.setY(document.getLastPos());
|
|
//datitab.setIsLinee(1);
|
|
|
|
tab.Colonne.Add(new Colonna("CodiceContratto", "Codice Contratto", 120, TipoAllineamento.SINISTRA, false, 7, false));
|
|
tab.Colonne.Add(new Colonna("NomeProdotto", "Nome Prodotto", 205, TipoAllineamento.SINISTRA, false, 7, false));
|
|
tab.Colonne.Add(new Colonna("Controvalore", "Controvalore* (€)", 103, TipoAllineamento.DESTRA, false, 7, false));
|
|
tab.Colonne.Add(new Colonna("Peso", "Peso** (%)", 92, TipoAllineamento.DESTRA, false, 7, false));
|
|
|
|
tab.AltezzaCella = 23;
|
|
|
|
datitab.setCellSpace(0);
|
|
|
|
//setta posizione tabella
|
|
tab.Draw(datitab, document);
|
|
|
|
float dim = datitab.GetRowDim() * (datitab.getNumRow() + 1);
|
|
#endregion
|
|
|
|
document.setLastPos(dim);
|
|
|
|
#region Tabella Totale Prodotti
|
|
|
|
datitab = new DatiTabella();
|
|
|
|
//Tabella tabProdotti = new Tabella(document.getMargineLeft(), document.getLastPos() + tab.AltezzaTabella + 30);
|
|
Tabella tabProdotti = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tab.HeaderFont = 8;
|
|
tabProdotti.AltezzaCella = 23;
|
|
tabProdotti.Header = false;
|
|
tabProdotti.LineaFineTabella = false;
|
|
tabProdotti.Datasource = set.Tables["TotaleProdotti"];
|
|
datitab.table = set.Tables["TotaleProdotti"];
|
|
|
|
//datitab.setY(document.getLastPos());
|
|
//datitab.setIsLinee(1);
|
|
|
|
tabProdotti.Colonne.Add(new Colonna("Descrizione", "", 328, TipoAllineamento.SINISTRA, true, 7, true));
|
|
tabProdotti.Colonne.Add(new Colonna("TotaleControvalore", "", 100, TipoAllineamento.DESTRA, true, 7, true));
|
|
tabProdotti.Colonne.Add(new Colonna("TotalePeso", "", 92, TipoAllineamento.DESTRA, true, 7, true));
|
|
|
|
tabProdotti.Draw(datitab, document);
|
|
#endregion
|
|
|
|
// setto la posizione aggiornata
|
|
//dim = datitab.GetRowDim();
|
|
//document.setLastPos(dim + 5);
|
|
|
|
#region Tabella Totale Patrimonio
|
|
datitab = new DatiTabella();
|
|
|
|
Tabella tabPatrimonio = new Tabella(document.getMargineLeft(), document.getLastPos() + tabProdotti.AltezzaCella + 3);
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tab.HeaderFont = 8;
|
|
tabPatrimonio.AltezzaCella = 23;
|
|
tabPatrimonio.Header = false;
|
|
tabPatrimonio.LineaFineTabella = false;
|
|
tabPatrimonio.Datasource = set.Tables["TotalePatrimonio"];
|
|
datitab.table = set.Tables["TotalePatrimonio"];
|
|
|
|
//datitab.setY(document.getLastPos());
|
|
//datitab.setIsLinee(1);
|
|
|
|
tabPatrimonio.Colonne.Add(new Colonna("Descrizione", "", 328, TipoAllineamento.SINISTRA, true, 7, true));
|
|
tabPatrimonio.Colonne.Add(new Colonna("TotaleControvalore", "", 100, TipoAllineamento.DESTRA, true, 7, true));
|
|
tabPatrimonio.Colonne.Add(new Colonna("TotalePeso", "", 92, TipoAllineamento.DESTRA, true, 7, true));
|
|
|
|
tabPatrimonio.Draw(datitab, document);
|
|
#endregion
|
|
|
|
//20180913 Aggiunto perché la tabella potrebbe essere molto lunga, quindi rimandare alla pagina successiva.
|
|
page = document.getCurrentPage();
|
|
|
|
#region Note
|
|
/*********************** Modifica per Trimestrale sovrapposizione note con tabella - Pino **************************/
|
|
//document.setLastPos(datitab.getNumRow());
|
|
|
|
if (datitab.getNumRow() == 1)
|
|
document.setLastPos(datitab.getNumRow() - 1);
|
|
else
|
|
document.setLastPos(datitab.GetRowDim() * (datitab.getNumRow() + 1));
|
|
/***************************************************************************************************************/
|
|
|
|
if (!string.IsNullOrEmpty(nota1))
|
|
{
|
|
|
|
/************* Modifica per la gestione della nota dinamica in base ai prodotti FAI 12/03/2021 - Pino *********************/
|
|
string testoNotaFAI = " Il controvalore dei fondi Perennius Global Yield Private 2011, Idea Crescita Globale, FAI Private Debt Special Opportunities e FAI Private Markets Insight esposto nella rendicontazione è determinato tramite il NAV trimestrale al #dataFAI# (ultimo disponibile alla data di predisposizione del presente rendiconto) al netto delle distribuzioni avvenute nel trimestre e accreditate sul conto corrente indicato in fase di sottoscrizione.";
|
|
|
|
DSNotaFAI _dsNotaFAI = new DSNotaFAI();
|
|
|
|
List<SessionStruct> tabelleSessione = new List<SessionStruct>();
|
|
DataTable _dt = new DataTable();
|
|
_dt.TableName = "[C6StagingPeriodico].[ClienteProdottiFAI]";
|
|
tabelleSessione.Add(new SessionStruct(string.Concat("[C6StagingPeriodico].[ClienteProdottiFAI]", "|", dataThread.Rete, "|", dataThread.CodiceFiscale), _dt));
|
|
|
|
DataSectionResult result = _dsNotaFAI.getDataSection(tabelleSessione, "[C6StagingPeriodico].[ClienteProdottiFAI]", dataThread);
|
|
DataSetNotaFAI setNotaFAI = (DataSetNotaFAI)result.DatiSezione;
|
|
|
|
string _flagNotaFAI = setNotaFAI.FlagNotaFAI.Rows[0][0].ToString();
|
|
if (_flagNotaFAI == "S")
|
|
{
|
|
// Sostituisco al marcatore nella variabile testoNotaFaI il valore presente nel datatable
|
|
testoNotaFAI = testoNotaFAI.Replace("#dataFAI#", setNotaFAI.FlagNotaFAI.Rows[0][1].ToString());
|
|
nota1 += testoNotaFAI;
|
|
}
|
|
/******************************************************************************************************************************/
|
|
|
|
FormattedTextArea text = new FormattedTextArea(nota1, document.getMargineLeft(), document.getLastPos() + tabPatrimonio.AltezzaCella - 5, 510, 50, new ceTe.DynamicPDF.FontFamily("pipp", Globals.OpenTypeFontVerdana, Globals.OpenTypeFontVerdanaB, Globals.OpenTypeFontVerdanaZ, Globals.OpenTypeFontVerdanaZ), 7, false);
|
|
text.Height = text.GetRequiredHeight();
|
|
text.Style.Paragraph.Align = ceTe.DynamicPDF.TextAlign.Justify;
|
|
page.Elements.Add(text);
|
|
dim = text.Height;
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(nota2))
|
|
{
|
|
FormattedTextArea text = new FormattedTextArea(nota2, document.getMargineLeft(), document.getLastPos() + tabPatrimonio.AltezzaCella + dim, 510, 50, new ceTe.DynamicPDF.FontFamily("pipp", Globals.OpenTypeFontVerdana, Globals.OpenTypeFontVerdanaB, Globals.OpenTypeFontVerdanaZ, Globals.OpenTypeFontVerdanaZ), 7, false);
|
|
text.Height = text.GetRequiredHeight();
|
|
text.Style.Paragraph.Align = ceTe.DynamicPDF.TextAlign.Justify;
|
|
page.Elements.Add(text);
|
|
}
|
|
#endregion
|
|
|
|
document.setLastPos(document.getLastPos() + 500);
|
|
}
|
|
else
|
|
{
|
|
document.setLastPos(document.getLastPos() + 500);
|
|
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
public void writeSezioneNew(DataThread dataThread)
|
|
{
|
|
DocumentPDF document = dataThread.DocumentPDF;
|
|
DataSetS180 set = (DataSetS180)dataThread.Data.DatiSezione;
|
|
|
|
//20180820 CR Professionali: la tabella non va visualizzata per i clienti professionali
|
|
if (!dataThread.IsProffesionalClient)
|
|
{
|
|
if (set.Tables["DettaglioComplessita"].Rows.Count > 0)
|
|
{
|
|
// 20181219 Fix bug di spaginazione della tabella complessità alta, in caso venga stampata a cavallo di due pagine
|
|
//if (!document.LastSectionCheckIn.Equals("S179")) // Se non si è passati per la S179
|
|
//if (!document.LastSectionCheckIn.Equals("S184")) // Se non si è passati per la S184 o per la 179
|
|
//{
|
|
// document.changePage();
|
|
// document.nextPage(document.getMargineLeft());
|
|
//}
|
|
//else
|
|
//{
|
|
// if (document.getLastPos() >= 500)
|
|
// {
|
|
// document.changePage();
|
|
// document.nextPage(document.getMargineLeft());
|
|
// }
|
|
//}
|
|
|
|
if (document.getLastPos() >= 940) //840
|
|
{
|
|
document.changePage();
|
|
document.nextPage(document.getMargineLeft());
|
|
}
|
|
|
|
ceTe.DynamicPDF.Merger.ImportedPage page = document.getCurrentPage();
|
|
|
|
document.setSezTitoloDiagnosi(dataThread.SezioneReport.Titolo);
|
|
|
|
string nota1 = dataThread.SezioneReport.Nota;
|
|
string nota2 = dataThread.SezioneReport.NotaAlternativa;
|
|
|
|
DataRow[] row = set.Tables["DettaglioComplessita"].Select("Ordine=1");
|
|
|
|
string testo = string.Empty;
|
|
if (row.Length > 0)
|
|
{
|
|
testo = row[0]["Descrizione"].ToString();
|
|
}
|
|
document.setChapterHeader(testo, 0, 520, 8);
|
|
//string tempTesto = dataThread.SezioneReport.TestoIntroduttivo;
|
|
|
|
//document.setChapterHeader(tempTesto.Replace("$/Banca/$", dataThread.NomeRete).Replace("Sanpaolo Invest", "Fideuram S.p.A., commercializzato tramite la rete di private banker Sanpaolo Invest"), 0, 520, 8);
|
|
|
|
document.setHeaderSpace(5);
|
|
|
|
DatiTabella datitab = new DatiTabella();
|
|
|
|
#region Tabella Dettaglio Complessita Prodotti Alta
|
|
Tabella tab = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tab.HeaderFont = 8;
|
|
tab.Header = true;
|
|
tab.LineaFineTabella = false;
|
|
tab.Datasource = datitab.table;
|
|
|
|
|
|
//Questa FIX serve per far comparire le intestazioni di tabella valide per tutte le altre qualora non ci fossero dati per la tabella DettaglioComplessita
|
|
//in tal caso l'altezza della cella è settata a 1 anche per il totale al fine di far salire sopra il resto della tabella
|
|
//INTESTAZIONE
|
|
int altezzaIntestazione;
|
|
if (set.Tables["DettaglioComplessita"].Select("Ordine=1").Length > 0)
|
|
{
|
|
datitab.table = set.Tables["DettaglioComplessita"].Select("Ordine=1").CopyToDataTable();
|
|
altezzaIntestazione = 23;
|
|
tab.AltezzaCella = altezzaIntestazione;
|
|
datitab.setCellSpace(0);
|
|
}
|
|
else
|
|
{
|
|
var emptyDt = new DataTable("DettaglioComplessita");
|
|
emptyDt.Columns.Add(new DataColumn("Complessita", typeof(System.String)));
|
|
emptyDt.Columns.Add(new DataColumn("Ordine", typeof(System.String)));
|
|
emptyDt.Columns.Add(new DataColumn("NomeProdotto", typeof(System.String)));
|
|
emptyDt.Columns.Add(new DataColumn("Controvalore", typeof(System.String)));
|
|
emptyDt.Columns.Add(new DataColumn("Descrizione", typeof(System.String)));
|
|
emptyDt.Columns.Add(new DataColumn("CodiceContratto", typeof(System.String)));
|
|
emptyDt.Columns.Add(new DataColumn("Peso", typeof(System.String)));
|
|
emptyDt.Columns.Add(new DataColumn("ControvaloreDecimale", typeof(System.String)));
|
|
emptyDt.Columns.Add(new DataColumn("PesoDecimale", typeof(System.String)));
|
|
|
|
emptyDt.Rows.Add();
|
|
|
|
datitab.table = emptyDt;
|
|
altezzaIntestazione = 1;
|
|
tab.AltezzaCella = altezzaIntestazione;
|
|
|
|
}
|
|
|
|
datitab.setY(document.getLastPos());
|
|
|
|
tab.Colonne.Add(new Colonna("CodiceContratto", "Codice Contratto", 80, TipoAllineamento.SINISTRA, false, 7, false));
|
|
tab.Colonne.Add(new Colonna("NomeProdotto", "Nome Prodotto", 148, TipoAllineamento.SINISTRA, false, 7, false));
|
|
tab.Colonne.Add(new Colonna("Complessita", "Complessità", 100, TipoAllineamento.DESTRA, false, 7, false));
|
|
tab.Colonne.Add(new Colonna("Controvalore", "Controvalore* (€)", 100, TipoAllineamento.DESTRA, false, 7, false));
|
|
tab.Colonne.Add(new Colonna("Peso", "Peso** (%)", 92, TipoAllineamento.DESTRA, false, 7, false));
|
|
|
|
//setta posizione tabella
|
|
tab.Draw(datitab, document);
|
|
|
|
float dim = datitab.GetRowDim() * datitab.getNumRow();
|
|
|
|
#endregion
|
|
|
|
document.setLastPos(dim + altezzaIntestazione);
|
|
|
|
#region Tabella Totale Complessita Prodotti Alta
|
|
|
|
datitab = new DatiTabella();
|
|
|
|
//Tabella tabProdotti = new Tabella(document.getMargineLeft(), document.getLastPos() + tab.AltezzaTabella + 30);
|
|
Tabella tabProdottiAlta = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
|
|
|
|
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tab.HeaderFont = 8;
|
|
//tabProdottiAlta.AltezzaCella = 23;
|
|
tabProdottiAlta.Header = false;
|
|
tabProdottiAlta.LineaFineTabella = false;
|
|
tabProdottiAlta.Datasource = set.Tables["TotaliComplessita"];
|
|
|
|
|
|
if (set.Tables["TotaliComplessita"].Select("Ordine=1").Length > 0)
|
|
{
|
|
tabProdottiAlta.AltezzaCella = 23;
|
|
|
|
datitab.table = set.Tables["TotaliComplessita"].Select("Ordine=1").CopyToDataTable();
|
|
//datitab.setY(dim);
|
|
datitab.setY(document.getLastPos());
|
|
|
|
tabProdottiAlta.Colonne.Add(new Colonna("Descrizione", "", 328, TipoAllineamento.SINISTRA, true, 7, true));
|
|
tabProdottiAlta.Colonne.Add(new Colonna("SommaControvalore", "", 100, TipoAllineamento.DESTRA, true, 7, true));
|
|
tabProdottiAlta.Colonne.Add(new Colonna("SommaPesi", "", 92, TipoAllineamento.DESTRA, true, 7, true));
|
|
|
|
|
|
|
|
tabProdottiAlta.Draw(datitab, document);
|
|
|
|
}
|
|
else
|
|
{
|
|
datitab.table = new DataTable();
|
|
tabProdottiAlta.AltezzaCella = 1;
|
|
}
|
|
|
|
|
|
float dimTA = datitab.GetRowDim() * (datitab.getNumRow() > 0 ? datitab.getNumRow() : 1);
|
|
#endregion
|
|
|
|
document.setLastPos(0);
|
|
|
|
|
|
#region Tabella Dettaglio Complessita Prodotti MedioAlta Alta
|
|
DatiTabella datitabMAA = new DatiTabella();
|
|
Tabella tabMedioAlta = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
|
|
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tabMedioAlta.HeaderFont = 8;
|
|
tabMedioAlta.Header = false;
|
|
tabMedioAlta.LineaFineTabella = false;
|
|
tabMedioAlta.Datasource = datitabMAA.table;
|
|
|
|
var x = set.Tables["DettaglioComplessita"].Select("Ordine=2");
|
|
|
|
if (x.Length > 0)
|
|
datitabMAA.table = set.Tables["DettaglioComplessita"].Select("Ordine=2").CopyToDataTable();
|
|
else
|
|
{
|
|
var pippo = new DataTable();
|
|
pippo.Columns.Add(new DataColumn("CodiceContratto", typeof(System.String)));
|
|
pippo.Columns.Add(new DataColumn("NomeProdotto", typeof(System.String)));
|
|
pippo.Columns.Add(new DataColumn("Complessita", typeof(System.String)));
|
|
pippo.Columns.Add(new DataColumn("Controvalore", typeof(System.String)));
|
|
pippo.Columns.Add(new DataColumn("Peso", typeof(System.String)));
|
|
|
|
|
|
pippo.Rows.Add();
|
|
datitabMAA.table = pippo;
|
|
}
|
|
|
|
datitabMAA.setY(document.getLastPos());
|
|
|
|
|
|
tabMedioAlta.Colonne.Add(new Colonna("CodiceContratto", "Codice Contratto", 80, TipoAllineamento.SINISTRA, false, 7, false));
|
|
tabMedioAlta.Colonne.Add(new Colonna("NomeProdotto", "Nome Prodotto", 148, TipoAllineamento.SINISTRA, false, 7, false));
|
|
tabMedioAlta.Colonne.Add(new Colonna("Complessita", "Complessità", 100, TipoAllineamento.DESTRA, false, 7, false));
|
|
tabMedioAlta.Colonne.Add(new Colonna("Controvalore", "Controvalore* (€)", 100, TipoAllineamento.DESTRA, false, 7, false));
|
|
tabMedioAlta.Colonne.Add(new Colonna("Peso", "Peso** (%)", 92, TipoAllineamento.DESTRA, false, 7, false));
|
|
|
|
tabMedioAlta.AltezzaCella = 23;
|
|
|
|
datitabMAA.setCellSpace(0);
|
|
|
|
//setta posizione tabella
|
|
tabMedioAlta.Draw(datitabMAA, document);
|
|
|
|
dim = datitabMAA.GetRowDim() * (datitabMAA.getNumRow() - 1);
|
|
|
|
|
|
#endregion
|
|
|
|
document.setLastPos(dim);
|
|
|
|
|
|
#region Tabella Totale Complessita Prodotti Medio Alta Alta
|
|
DatiTabella datitabTotMAA = new DatiTabella();
|
|
|
|
|
|
|
|
//Tabella tabProdotti = new Tabella(document.getMargineLeft(), document.getLastPos() + tab.AltezzaTabella + 30);
|
|
Tabella tabProdottiMedioAlta = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tabProdottiMedioAlta.HeaderFont = 8;
|
|
tabProdottiMedioAlta.AltezzaCella = 23;
|
|
tabProdottiMedioAlta.Header = false;
|
|
tabProdottiMedioAlta.LineaFineTabella = false;
|
|
tabProdottiMedioAlta.Datasource = datitabTotMAA.table;
|
|
|
|
|
|
var xTot = set.Tables["TotaliComplessita"].Select("Ordine=2");
|
|
|
|
if (x.Length > 0)
|
|
datitabTotMAA.table = set.Tables["TotaliComplessita"].Select("Ordine=2").CopyToDataTable();
|
|
else
|
|
{
|
|
var pippoTot = new DataTable();
|
|
pippoTot.Columns.Add(new DataColumn("Descrizione", typeof(System.String)));
|
|
pippoTot.Columns.Add(new DataColumn("SommaControvalore", typeof(System.String)));
|
|
pippoTot.Columns.Add(new DataColumn("SommaPesi", typeof(System.String)));
|
|
|
|
|
|
pippoTot.Rows.Add();
|
|
datitabTotMAA.table = pippoTot;
|
|
}
|
|
|
|
tabProdottiMedioAlta.Colonne.Add(new Colonna("Descrizione", "", 328, TipoAllineamento.SINISTRA, true, 7, true));
|
|
tabProdottiMedioAlta.Colonne.Add(new Colonna("SommaControvalore", "", 100, TipoAllineamento.DESTRA, true, 7, true));
|
|
tabProdottiMedioAlta.Colonne.Add(new Colonna("SommaPesi", "", 92, TipoAllineamento.DESTRA, true, 7, true));
|
|
|
|
tabProdottiMedioAlta.Draw(datitabTotMAA, document);
|
|
#endregion
|
|
|
|
document.setLastPos(0);
|
|
|
|
#region Tabella Dettaglio Complessita Prodotti MedioBasso MedioAlta Alta
|
|
DatiTabella datitabMAMBA = new DatiTabella();
|
|
|
|
|
|
Tabella tabMedioBassoMeadioAltaAlta = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tabMedioBassoMeadioAltaAlta.HeaderFont = 8;
|
|
tabMedioBassoMeadioAltaAlta.Header = false;
|
|
tabMedioBassoMeadioAltaAlta.LineaFineTabella = false;
|
|
tabMedioBassoMeadioAltaAlta.Datasource = datitabMAMBA.table;
|
|
|
|
datitabMAMBA.table = set.Tables["DettaglioComplessita"].Select("Ordine=3").CopyToDataTable();
|
|
|
|
datitabMAMBA.setY(document.getLastPos());
|
|
|
|
|
|
tabMedioBassoMeadioAltaAlta.Colonne.Add(new Colonna("CodiceContratto", "Codice Contratto", 80, TipoAllineamento.SINISTRA, false, 7, false));
|
|
tabMedioBassoMeadioAltaAlta.Colonne.Add(new Colonna("NomeProdotto", "Nome Prodotto", 148, TipoAllineamento.SINISTRA, false, 7, false));
|
|
tabMedioBassoMeadioAltaAlta.Colonne.Add(new Colonna("Complessita", "Complessità", 100, TipoAllineamento.DESTRA, false, 7, false));
|
|
tabMedioBassoMeadioAltaAlta.Colonne.Add(new Colonna("Controvalore", "Controvalore* (€)", 100, TipoAllineamento.DESTRA, false, 7, false));
|
|
tabMedioBassoMeadioAltaAlta.Colonne.Add(new Colonna("Peso", "Peso** (%)", 92, TipoAllineamento.DESTRA, false, 7, false));
|
|
|
|
tabMedioBassoMeadioAltaAlta.AltezzaCella = 23;
|
|
|
|
datitabMAMBA.setCellSpace(0);
|
|
|
|
//setta posizione tabella
|
|
tabMedioBassoMeadioAltaAlta.Draw(datitabMAMBA, document);
|
|
|
|
dim = datitabMAMBA.GetRowDim() * (datitabMAMBA.getNumRow() - 1);
|
|
#endregion
|
|
|
|
document.setLastPos(dim);
|
|
|
|
|
|
#region Tabella Totale Complessita Prodotti Medio Bassa Medio Alta Alta
|
|
DatiTabella datitabTotMBMAA = new DatiTabella();
|
|
Tabella tabProdottiMedioBMAA = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tabProdottiMedioBMAA.HeaderFont = 8;
|
|
tabProdottiMedioBMAA.AltezzaCella = 23;
|
|
tabProdottiMedioBMAA.Header = false;
|
|
tabProdottiMedioBMAA.LineaFineTabella = false;
|
|
tabProdottiMedioBMAA.Datasource = datitabTotMBMAA.table;
|
|
datitabTotMBMAA.table = set.Tables["TotaliComplessita"].Select("Ordine=3").CopyToDataTable(); ;
|
|
|
|
|
|
|
|
tabProdottiMedioBMAA.Colonne.Add(new Colonna("Descrizione", "", 328, TipoAllineamento.SINISTRA, true, 7, true));
|
|
tabProdottiMedioBMAA.Colonne.Add(new Colonna("SommaControvalore", "", 100, TipoAllineamento.DESTRA, true, 7, true));
|
|
tabProdottiMedioBMAA.Colonne.Add(new Colonna("SommaPesi", "", 92, TipoAllineamento.DESTRA, true, 7, true));
|
|
|
|
tabProdottiMedioBMAA.Draw(datitabTotMBMAA, document);
|
|
|
|
dim = datitabTotMBMAA.GetRowDim() * (datitabTotMBMAA.getNumRow() - 1);
|
|
#endregion
|
|
|
|
//document.setLastPos(dim - 10);
|
|
|
|
|
|
|
|
#region Tabella Totale Generale
|
|
DatiTabella datitabTotGenerale = new DatiTabella();
|
|
Tabella tabTotGenerale = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
|
|
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tabTotGenerale.HeaderFont = 8;
|
|
tabTotGenerale.AltezzaCella = 23;
|
|
tabTotGenerale.Header = false;
|
|
tabTotGenerale.LineaFineTabella = false;
|
|
tabTotGenerale.Datasource = datitabTotGenerale.table;
|
|
datitabTotGenerale.table = set.Tables["TotaleGenerale"];
|
|
|
|
tabTotGenerale.Colonne.Add(new Colonna("Descrizione", "", 328, TipoAllineamento.SINISTRA, true, 7, true));
|
|
tabTotGenerale.Colonne.Add(new Colonna("TotalePatrimonioCTV", "", 100, TipoAllineamento.DESTRA, true, 7, true));
|
|
tabTotGenerale.Colonne.Add(new Colonna("TotalePatrimonioPesi", "", 92, TipoAllineamento.DESTRA, true, 7, true));
|
|
|
|
//tabTotGenerale.Draw(datitabTotGenerale, document);
|
|
|
|
|
|
#endregion
|
|
|
|
//Rimozione della pagina bianca dopo l'ultima
|
|
var xxxx = document.getLastPos();
|
|
document.setLastPos(document.getLastPos() * -1);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|