1557 lines
70 KiB
C#
1557 lines
70 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
|
|
using ceTe.DynamicPDF.Merger;
|
|
using PDFGenerator.BusinessLayer.DataSection;
|
|
using PDFGenerator.Presentation.Section.Tables;
|
|
using PDFGenerator.BusinessLayer;
|
|
using ceTe.DynamicPDF.PageElements;
|
|
using System.Linq;
|
|
using System.Data;
|
|
|
|
namespace PDFGenerator.Presentation.Section
|
|
{
|
|
public class FD160 : ISezione
|
|
{
|
|
DataSetS160 set;
|
|
ImportedPage page;
|
|
|
|
string _Area;
|
|
string _Progetto;
|
|
private string _titolosezione = string.Empty;
|
|
private string _ordinamentoProgetto = string.Empty;
|
|
|
|
//MIFID2 20180420
|
|
string notaSezione = string.Empty;
|
|
bool notaSezioneStampata = false;
|
|
bool moreTables = false;
|
|
int tableCount;
|
|
//--MIFID2
|
|
|
|
// 20181204
|
|
bool spazioNotaLasciato = false;
|
|
//--20181204
|
|
|
|
public string OrdinamentoProgetto
|
|
{
|
|
get { return _ordinamentoProgetto; }
|
|
set { _ordinamentoProgetto = value; }
|
|
}
|
|
|
|
|
|
public FD160()
|
|
{
|
|
//
|
|
// TODO: Add constructor logic here
|
|
//
|
|
}
|
|
|
|
#region ISezione Members
|
|
|
|
|
|
/// <summary>
|
|
/// Stampa la sezione per area di bisogno.
|
|
/// Se l'area investimento ha più di 1 progetto, verrà aggiunta una riga, in grassetto, per ciascun progetto
|
|
/// come titolo del progetto d'investimento.
|
|
/// </summary>
|
|
/// <param name="dataThread"></param>
|
|
public void writeSezione(DataThread dataThread)
|
|
{
|
|
|
|
bool _mostratitolosezione = true;
|
|
string printedArea = string.Empty;
|
|
DocumentPDF document = dataThread.DocumentPDF;
|
|
DatiTabella datitab = new DatiTabella();
|
|
set = (DataSetS160)dataThread.Data.DatiSezione;
|
|
|
|
notaSezione = dataThread.SezioneReport.Nota;
|
|
|
|
/************* 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.";
|
|
|
|
string _flagNotaFAI = set.FlagNotaFAI.Rows[0][0].ToString();
|
|
if (_flagNotaFAI == "S")
|
|
{
|
|
testoNotaFAI = testoNotaFAI.Replace("#dataFAI#", set.FlagNotaFAI.Rows[0][1].ToString());
|
|
notaSezione += testoNotaFAI;
|
|
}
|
|
/******************************************************************************************************************************/
|
|
|
|
document.NotaPieDiPagina = notaSezione;
|
|
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
|
|
//--MIFID2
|
|
|
|
page = document.getCurrentPage();
|
|
|
|
#region Recupero i dati da stampare
|
|
|
|
|
|
DataRow[] drFilterAreaProgetto;
|
|
DataTable dtTabellaDati = new DataTable();
|
|
DataTable tempdtTabellaDati = new DataTable();
|
|
|
|
DataView view;
|
|
|
|
datitab.table = set.Tables["ProdottiAreeBisogno"];
|
|
dtTabellaDati = datitab.table;
|
|
tempdtTabellaDati = datitab.table;
|
|
|
|
|
|
DataView viewDistinctAreas = new DataView(set.Tables["ProdottiAreeBisogno"]);
|
|
DataTable distinctValues = viewDistinctAreas.ToTable(true, "CodiceAreaBisogno");
|
|
moreTables = distinctValues.Rows.Count > 1;
|
|
tableCount = distinctValues.Rows.Count;
|
|
//--MIFID2
|
|
|
|
view = new DataView(datitab.table);
|
|
|
|
|
|
if (!string.IsNullOrEmpty(dataThread.Area) || !string.IsNullOrEmpty(dataThread.Progetto))
|
|
{
|
|
if (dataThread.Area.ToUpper() != "NA")
|
|
{
|
|
view.RowFilter = ("OrdinamentoProgetto ='" + _ordinamentoProgetto + "' and " + "CodiceAreaBisogno = '" + dataThread.Area + "' and progetto='" + dataThread.Progetto.Replace("'", "''") + "'");
|
|
datitab.table = view.ToTable();
|
|
dtTabellaDati = datitab.table;
|
|
}
|
|
else
|
|
{
|
|
view.RowFilter = ("CodiceAreaBisogno = '" + dataThread.Area + "' and progetto='" + dataThread.Progetto.Replace("'", "''") + "'");
|
|
datitab.table = view.ToTable();
|
|
dtTabellaDati = datitab.table;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region stampo solo Robo
|
|
string titoloRibilanciato = "Portafoglio Direct Evo"; //"Portafoglio Ribilanciato";
|
|
drFilterAreaProgetto = dtTabellaDati.Select(" CodiceAreaBisogno = 'Rob'");
|
|
|
|
if (drFilterAreaProgetto.Length > 0)
|
|
{
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
|
|
//--MIFID2
|
|
|
|
if (_mostratitolosezione)
|
|
{
|
|
if (string.IsNullOrEmpty(_titolosezione))
|
|
{
|
|
if (!titoloRibilanciato.Equals(""))
|
|
{
|
|
document.setTitolo(titoloRibilanciato);
|
|
document.setSezTitoloWithoutNumber(drFilterAreaProgetto[0].Field<string>("Progetto").ToString());
|
|
titoloRibilanciato = "";
|
|
}
|
|
}
|
|
else
|
|
document.setTitolo(_titolosezione);
|
|
}
|
|
|
|
this.writeArea(dataThread, datitab, document, "Rob");
|
|
|
|
//MIFID2 20180514 una volta stampata la tabella, decremento il contatore
|
|
//tableCount--;
|
|
}
|
|
#endregion
|
|
|
|
#region Stampo gli altri prodotti
|
|
string titoloAltriStrumenti = "Portafoglio base"; //"Altri strumenti finanziari";
|
|
drFilterAreaProgetto = dtTabellaDati.Select(" CodiceAreaBisogno <> 'Rob'");
|
|
|
|
/*Ciclo sull array e modifico il valore CodiceAreaBisogno*/
|
|
//foreach (var item in drFilterAreaProgetto)
|
|
//{
|
|
// item["CodiceAreaBisogno"] = "ASF";
|
|
//}
|
|
|
|
if (drFilterAreaProgetto.Length > 0)
|
|
{
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
|
|
//--MIFID2
|
|
|
|
if (_mostratitolosezione)
|
|
{
|
|
if (string.IsNullOrEmpty(_titolosezione))
|
|
{
|
|
if (!titoloAltriStrumenti.Equals(""))
|
|
{
|
|
document.setTitolo(titoloAltriStrumenti);
|
|
titoloAltriStrumenti = "";
|
|
}
|
|
}
|
|
else
|
|
document.setTitolo(_titolosezione);
|
|
}
|
|
|
|
this.writeArea(dataThread, datitab, document, "ASF");
|
|
|
|
//MIFID2 20180514 una volta stampata la tabella, decremento il contatore
|
|
//tableCount--;
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region Stampo la tabella Liquidità
|
|
string titoloLiq = "Liquidità";
|
|
drFilterAreaProgetto = dtTabellaDati.Select(" CodiceAreaBisogno = 'Liq'");
|
|
|
|
if (drFilterAreaProgetto.Length > 0)
|
|
{
|
|
if (string.IsNullOrEmpty(printedArea))
|
|
printedArea += "'Liq'";
|
|
else
|
|
printedArea += " , 'Liq'";
|
|
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
|
|
//--MIFID2
|
|
|
|
if (_mostratitolosezione)
|
|
{
|
|
if (string.IsNullOrEmpty(_titolosezione))
|
|
{
|
|
if (!titoloLiq.Equals(""))
|
|
{
|
|
document.setTitolo("Liquidità");
|
|
titoloLiq = "";
|
|
}
|
|
}
|
|
else
|
|
document.setTitolo(_titolosezione);
|
|
}
|
|
|
|
this.writeArea(dataThread, datitab, document, "Liq");
|
|
|
|
//MIFID2 20180514 una volta stampata la tabella, decremento il contatore
|
|
//tableCount--;
|
|
}
|
|
#endregion
|
|
|
|
#region Conto Corrente a saldo negativo
|
|
|
|
drFilterAreaProgetto = dtTabellaDati.Select(" CodiceAreaBisogno = 'Cc'");
|
|
|
|
|
|
if (drFilterAreaProgetto.Length > 0 && set.ContoCorrente.Rows.Count > 0)
|
|
{
|
|
|
|
if (string.IsNullOrEmpty(printedArea))
|
|
printedArea += "'CC'";
|
|
else
|
|
printedArea += " , 'CC'";
|
|
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
|
|
//--MIFID2
|
|
|
|
if (_mostratitolosezione)
|
|
{
|
|
if (string.IsNullOrEmpty(_titolosezione))
|
|
{
|
|
if (!titoloLiq.Equals(""))
|
|
{
|
|
document.setTitolo("Liquidità");
|
|
titoloLiq = "";
|
|
}
|
|
}
|
|
else
|
|
document.setTitolo(_titolosezione);
|
|
}
|
|
|
|
this.writeArea(dataThread, datitab, document, "CC");
|
|
|
|
//MIFID2 20180514 una volta stampata la tabella, decremento il contatore
|
|
//tableCount--;
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region Linea Self a saldo negativo
|
|
|
|
drFilterAreaProgetto = dtTabellaDati.Select(" CodiceAreaBisogno = 'Self'");
|
|
|
|
|
|
if (set.LineaSelf.Rows.Count > 0)
|
|
{
|
|
|
|
tableCount++;
|
|
|
|
if (string.IsNullOrEmpty(printedArea))
|
|
printedArea += "'Self'";
|
|
else
|
|
printedArea += " , 'Self'";
|
|
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
// 20181204
|
|
|
|
datitab.table = set.LineaSelf;
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
//{
|
|
// document.addPage();
|
|
// notaSezioneStampata = false;
|
|
//}
|
|
//--20181204
|
|
|
|
//--MIFID2
|
|
|
|
if (_mostratitolosezione)
|
|
{
|
|
if (string.IsNullOrEmpty(_titolosezione))
|
|
{
|
|
if (!titoloLiq.Equals(""))
|
|
{
|
|
document.setTitolo("Liquidità");
|
|
titoloLiq = "";
|
|
}
|
|
}
|
|
else
|
|
document.setTitolo(_titolosezione);
|
|
}
|
|
|
|
this.writeArea(dataThread, datitab, document, "Self");
|
|
|
|
//MIFID2 20180514 una volta stampata la tabella, decremento il contatore
|
|
//tableCount--;
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region Stampo la tabella Riserva
|
|
|
|
drFilterAreaProgetto = dtTabellaDati.Select(" CodiceAreaBisogno = 'Ris'");
|
|
|
|
if (drFilterAreaProgetto.Length > 0)
|
|
{
|
|
if (string.IsNullOrEmpty(printedArea))
|
|
printedArea += "'Ris'";
|
|
else
|
|
printedArea += " , 'Ris'";
|
|
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
|
|
//--MIFID2
|
|
|
|
if (dataThread.TipoReport.ToUpper().Equals("DIAGNOSI"))
|
|
{
|
|
if (_mostratitolosezione)
|
|
{
|
|
if (string.IsNullOrEmpty(_titolosezione))
|
|
document.setTitolo("Riserva");
|
|
else
|
|
document.setTitolo(_titolosezione);
|
|
|
|
}
|
|
}
|
|
this.writeArea(dataThread, datitab, document, "Ris");
|
|
|
|
//MIFID2 20180514 una volta stampata la tabella, decremento il contatore
|
|
//tableCount--;
|
|
}
|
|
#endregion
|
|
|
|
#region Stampo la tabella Previdenza
|
|
|
|
drFilterAreaProgetto = dtTabellaDati.Select(" CodiceAreaBisogno = 'Pre'");
|
|
|
|
if (drFilterAreaProgetto.Length > 0)
|
|
{
|
|
if (string.IsNullOrEmpty(printedArea))
|
|
printedArea += "'Pre'";
|
|
else
|
|
printedArea += " , 'Pre'";
|
|
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
|
|
//--MIFID2
|
|
|
|
if (dataThread.TipoReport.ToUpper().Equals("DIAGNOSI"))
|
|
{
|
|
if (_mostratitolosezione)
|
|
{
|
|
if (string.IsNullOrEmpty(_titolosezione))
|
|
document.setTitolo("Previdenza");
|
|
else
|
|
document.setTitolo(_titolosezione);
|
|
|
|
}
|
|
}
|
|
this.writeArea(dataThread, datitab, document, "Pre");
|
|
|
|
//MIFID2 20180514 una volta stampata la tabella, decremento il contatore
|
|
//tableCount--;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Stampo la tabella Investimento
|
|
|
|
drFilterAreaProgetto = dtTabellaDati.Select(" CodiceAreaBisogno = 'Inv'");
|
|
|
|
if (drFilterAreaProgetto.Length > 0)
|
|
{
|
|
if (string.IsNullOrEmpty(printedArea))
|
|
printedArea += "'Inv'";
|
|
else
|
|
printedArea += " , 'Inv'";
|
|
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
|
|
//--MIFID2
|
|
|
|
if (dataThread.TipoReport.ToUpper().Equals("DIAGNOSI"))
|
|
{
|
|
if (_mostratitolosezione)
|
|
{
|
|
if (string.IsNullOrEmpty(_titolosezione))
|
|
document.setTitolo("Investimento");
|
|
else
|
|
document.setTitolo(_titolosezione);
|
|
}
|
|
}
|
|
|
|
this.writeArea(dataThread, datitab, document, "Inv");
|
|
|
|
//MIFID2 20180514 una volta stampata la tabella, decremento il contatore
|
|
//tableCount--;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Stampo la tabella Extra rendimento
|
|
|
|
drFilterAreaProgetto = dtTabellaDati.Select(" CodiceAreaBisogno = 'Ext'");
|
|
|
|
if (drFilterAreaProgetto.Length > 0)
|
|
{
|
|
if (string.IsNullOrEmpty(printedArea))
|
|
printedArea += "'Ext'";
|
|
else
|
|
printedArea += " , 'Ext'";
|
|
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
|
|
//--MIFID2
|
|
|
|
if (dataThread.TipoReport.ToUpper().Equals("DIAGNOSI"))
|
|
{
|
|
if (_mostratitolosezione)
|
|
{
|
|
if (string.IsNullOrEmpty(_titolosezione))
|
|
document.setTitolo("Extra Rendimento");
|
|
else
|
|
document.setTitolo(_titolosezione);
|
|
}
|
|
}
|
|
|
|
//MIFID2 20180514 una volta stampata la tabella, decremento il contatore
|
|
//tableCount--;
|
|
|
|
this.writeArea(dataThread, datitab, document, "Ext");
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region Stampo la tabella Risorse non allocate
|
|
|
|
|
|
drFilterAreaProgetto = dtTabellaDati.Select(" CodiceAreaBisogno = 'Na'");
|
|
|
|
if (drFilterAreaProgetto.Length > 0)
|
|
{
|
|
if (string.IsNullOrEmpty(printedArea))
|
|
printedArea += "'Na'";
|
|
else
|
|
printedArea += " , 'Na'";
|
|
|
|
//MIFID2 20180514 se cambia pagina resetto il flag notastampata
|
|
//orig:
|
|
//if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
// document.addPage();
|
|
|
|
if (document.checkMargin(datitab.GetRowDim() * 4))
|
|
{
|
|
document.addPage();
|
|
notaSezioneStampata = false;
|
|
}
|
|
|
|
//--MIFID2
|
|
|
|
if (dataThread.TipoReport.ToUpper().Equals("DIAGNOSI"))
|
|
{
|
|
if (_mostratitolosezione)
|
|
{
|
|
if (string.IsNullOrEmpty(_titolosezione))
|
|
document.setTitolo("Risorse non allocate");
|
|
else
|
|
document.setTitolo(_titolosezione);
|
|
}
|
|
}
|
|
|
|
|
|
this.writeArea(dataThread, datitab, document, "Na");
|
|
//MIFID2 20180514 una volta stampata la tabella, decremento il contatore
|
|
//tableCount--;
|
|
|
|
}
|
|
#endregion
|
|
|
|
if (document.DocumentNotes.Rows.Count > 0)
|
|
document.WriteNote2(notaSezione, dataThread.IsSavingMap, dataThread.IsAPC103); //Aggiunta isAPC103
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
/// <summary>
|
|
/// Disegna la tabella per Area (non d'investimento).
|
|
/// </summary>
|
|
/// <param name="datitab"></param>
|
|
/// <param name="document"></param>
|
|
/// <param name="area"></param>
|
|
private void writeArea(DataThread dataThread, DatiTabella datitab, DocumentPDF document, string area)
|
|
{
|
|
|
|
//MIFID2 20180514
|
|
tableCount--;
|
|
//--MIFID2
|
|
|
|
if (area.ToUpper().Equals("INV"))
|
|
{
|
|
if (!string.IsNullOrEmpty(dataThread.Area) || !string.IsNullOrEmpty(dataThread.Progetto))
|
|
this.writeAreaProgetto_Monitoraggio(dataThread, datitab, document, "Inv");
|
|
else
|
|
this.writeAreaProgetto(dataThread, datitab, document, "Inv");
|
|
return;
|
|
}
|
|
|
|
float lastPosition = 0;
|
|
int fontdim = 8;
|
|
page = document.getCurrentPage();
|
|
FormatNum conv = new FormatNum();
|
|
string notaGradoCopertura = string.Empty;
|
|
|
|
//setta la datatable
|
|
datitab.table = set.Tables["ProdottiAreeBisogno"];
|
|
|
|
// Disegno la tabella
|
|
Tabella tabellaDettaglio_Area = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
tabellaDettaglio_Area.HeaderFont = 8;
|
|
tabellaDettaglio_Area.Header = true;
|
|
tabellaDettaglio_Area.Datasource = datitab.table;
|
|
tabellaDettaglio_Area.Id = "tabella_" + area;
|
|
tabellaDettaglio_Area.LineaFineTabella = true;
|
|
|
|
tabellaDettaglio_Area.ColoreDirectBankB = "green";
|
|
|
|
// filtro per l'area
|
|
DataView view = new DataView(datitab.table);
|
|
view.RowFilter = ("CodiceAreaBisogno = '" + area + "'");
|
|
datitab.table = view.ToTable();
|
|
|
|
//MIFID2 20180619 Se il documento non ha nessuna nota nella lista di note, mi serve aggiungerne una "finta" per avere il numero di asterischi che parte da 2 (includendo la nota fissa sul Ctv)
|
|
if (document.Note.Count == 0)
|
|
document.Note.Add(new Nota(Nota.TipologiaNota.NonImpostato, tabellaDettaglio_Area.Id, ""));
|
|
//--MIFID2
|
|
|
|
#region Tutti tranne CC e INV
|
|
|
|
if (area.ToUpper() != "CC" && area.ToUpper() != "INV" && datitab.table.Rows.Count > 0)
|
|
{
|
|
notaGradoCopertura = datitab.table.Rows[0]["Copertura"] == DBNull.Value ? string.Empty : datitab.table.Rows[0]["Copertura"].ToString();
|
|
if (notaGradoCopertura.Length > 0)
|
|
{
|
|
//20180817 va mantenuta la nota fittizia altrimenti viene stampata la nota copertura con un solo asterisco così come quella fissa sul ctv
|
|
//document.Note.Clear();
|
|
//20180817
|
|
document.Note.Add(new Nota(Nota.TipologiaNota.GradoCopertura, tabellaDettaglio_Area.Id, notaGradoCopertura));
|
|
tabellaDettaglio_Area.NotaTabella.Add(document.Note.Find(Nota.TipologiaNota.GradoCopertura, tabellaDettaglio_Area.Id).Testo);
|
|
}
|
|
|
|
//20180620 serve ad eliminare la nota finta, che altrimenti verrebbe stampata
|
|
document.Note.RemoveAt(0);
|
|
|
|
//MIFID2 20180419 inserito asterisco alla colonna Controvalore
|
|
//tabellaDettaglio_Area.Colonne.Add(new Colonna("DataSottoscrizione", "Data sott.", 60, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaDettaglio_Area.Colonne.Add(new Colonna("Descrizione", "Descrizione", 287, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaDettaglio_Area.Colonne.Add(new Colonna("<IMAGE>", " ", 10, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaDettaglio_Area.Colonne.Add(new Colonna("Controvalore", "Controvalore (€)", 90, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
//tabellaDettaglio_Area.Colonne.Add(new Colonna("Var", "Rischio<BR>(VaR %)", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
tabellaDettaglio_Area.Colonne.Add(new Colonna("DataSottoscrizione", "Data sott.", 60, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
tabellaDettaglio_Area.Colonne.Add(new Colonna("<IMAGE>", " ", 10, TipoAllineamento.DESTRA, false, fontdim, false, TipoColonna.IMMAGINE));
|
|
tabellaDettaglio_Area.Colonne.Add(new Colonna("Descrizione", "Descrizione", 282, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
tabellaDettaglio_Area.Colonne.Add(new Colonna("Controvalore", "Controvalore* (€)", 95, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
tabellaDettaglio_Area.Colonne.Add(new Colonna("Var", "Rischio<BR>(VaR %)", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
//--MIFID2
|
|
|
|
//MIFID2 20180601 Gestione nota, salvare informazione su tabella corrente
|
|
document.DocumentNotes.Rows.Add(area, 0, document.CurrentPage);
|
|
|
|
//tabellaDettaglio_Area.Draw(datitab, document, notaSezione, tableCount == 0, ref notaSezioneStampata);
|
|
tabellaDettaglio_Area.DrawDiagnosi(datitab, document, notaSezione);
|
|
//--MIFID2
|
|
|
|
datitab = new DatiTabella();
|
|
datitab.table = set.Tables["ProdottiTotale"];
|
|
datitab.CellClear();
|
|
|
|
DataView view2 = new DataView(datitab.table);
|
|
view2.RowFilter = ("CodiceAreaBisogno = '" + area + "'");
|
|
datitab.table = view2.ToTable();
|
|
|
|
//Imposto gli asterischi di rimando nel caso in cui sia presente la nota del grado copertura
|
|
if (notaGradoCopertura.Length > 0)
|
|
datitab.table.Rows[0]["Var"] = datitab.table.Rows[0]["Var"].ToString() + document.Note.Find(Nota.TipologiaNota.GradoCopertura, tabellaDettaglio_Area.Id).ToString();
|
|
|
|
Tabella tabellaTotali_Area = new Tabella(document.getMargineLeft(), document.getLastPos() + tabellaDettaglio_Area.AltezzaTabella + 25);
|
|
tabellaTotali_Area.HeaderFont = 8;
|
|
tabellaTotali_Area.Header = false;
|
|
tabellaTotali_Area.SaltoPagina = false;
|
|
|
|
tabellaTotali_Area.Colonne.Add(new Colonna("Totale", "", 337, TipoAllineamento.SINISTRA, true, fontdim, true));
|
|
tabellaTotali_Area.Colonne.Add(new Colonna("Controvalore", "", 110, TipoAllineamento.DESTRA, true, fontdim, true));
|
|
tabellaTotali_Area.Colonne.Add(new Colonna("Var", "", 65, TipoAllineamento.DESTRA, true, fontdim, true));
|
|
|
|
tabellaTotali_Area.Draw(datitab, document);
|
|
|
|
lastPosition = tabellaTotali_Area.AltezzaTabella + tabellaDettaglio_Area.AltezzaTabella;
|
|
|
|
//MIFID2 20180601 DocumentNotes
|
|
// Memorizzare la posizione della nota e il numero pagina
|
|
// 20180619 se c'è la nota grado copertura bisogna aggiungere spazio
|
|
//document.AddDocumentNote(NomeArea, document.getLastPos() + lastPosition, document.CurrentPage);
|
|
|
|
if (!string.IsNullOrEmpty(notaGradoCopertura))
|
|
{
|
|
document.AddDocumentNote(area, document.getLastPos() + lastPosition + 10, document.CurrentPage);
|
|
document.setLastPos(lastPosition + 10);
|
|
}
|
|
else
|
|
{
|
|
document.AddDocumentNote(area, document.getLastPos() + lastPosition, document.CurrentPage);
|
|
document.setLastPos(lastPosition);
|
|
}
|
|
//--20180619
|
|
//--MIFID2
|
|
|
|
//document.setLastPos(lastPosition);
|
|
}
|
|
#endregion
|
|
|
|
#region Conti correnti a saldo negativo
|
|
|
|
if (area.ToUpper() == "CC" && set.ContoCorrente.Rows.Count > 0)
|
|
{
|
|
// 20181204 Per gestire lo spazio che bisogna lasciare per un'eventuale nota sul controvalore che va direttamente sotto la tabella area precedente
|
|
if (document.DocumentNotes.Rows.Count > 0)
|
|
{
|
|
document.setLastPos(5);
|
|
spazioNotaLasciato = true;
|
|
}
|
|
|
|
document.setTitolo("Conti correnti a saldo negativo");
|
|
|
|
datitab = new DatiTabella();
|
|
datitab.table = set.Tables["ContoCorrente"];
|
|
datitab.CellClear();
|
|
|
|
|
|
DataView view3 = new DataView(datitab.table);
|
|
datitab.table = view3.ToTable();
|
|
|
|
for (int i = 0; i < datitab.table.Rows.Count; i++)
|
|
datitab.table.Rows[i]["Var"] = conv.ConvertNum(datitab.table.Rows[i]["Var"]);
|
|
|
|
|
|
//Imposto gli asterischi di rimando nel caso in cui sia presente la nota del grado copertura
|
|
if (notaGradoCopertura.Length > 0)
|
|
datitab.table.Rows[0]["Var"] = datitab.table.Rows[0]["Var"].ToString()
|
|
+ document.Note.Find(Nota.TipologiaNota.GradoCopertura, tabellaDettaglio_Area.Id).ToString();
|
|
|
|
Tabella NewtabellaTotali_Area = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
NewtabellaTotali_Area.HeaderFont = 8;
|
|
NewtabellaTotali_Area.Header = true;
|
|
NewtabellaTotali_Area.SaltoPagina = false;
|
|
|
|
NewtabellaTotali_Area.Colonne.Add(new Colonna("Data", "Data di apertura", 60, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
NewtabellaTotali_Area.Colonne.Add(new Colonna("Numero", "Numero di c/c", 224, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
NewtabellaTotali_Area.Colonne.Add(new Colonna("<IMAGE>", " ", 5, TipoAllineamento.DESTRA, false, fontdim, false, TipoColonna.IMMAGINE));
|
|
NewtabellaTotali_Area.Colonne.Add(new Colonna("SaldoContabile", " Saldo<BR>Contabile", 80, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
NewtabellaTotali_Area.Colonne.Add(new Colonna("SaldoDisponibile", " Saldo<BR>Disponibile", 80, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
NewtabellaTotali_Area.Colonne.Add(new Colonna("Var", "Rischio<BR>(VaR%)", 60, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
|
|
// 20181204 Gestione nota, salvare informazione su tabella corrente
|
|
//document.DocumentNotes.Rows.Add(area, 0, document.CurrentPage);
|
|
|
|
// Scrive la tabella Totali
|
|
NewtabellaTotali_Area.DrawDiagnosi(datitab, document, notaSezione);
|
|
lastPosition = NewtabellaTotali_Area.AltezzaTabella;// +NewtabellaTotali_Area.AltezzaTabella;
|
|
|
|
// 20181204 Gestione nota, salvare informazione su tabella corrente
|
|
// document.AddDocumentNote(area, document.getLastPos() + lastPosition, document.CurrentPage);
|
|
|
|
document.setLastPos(lastPosition);
|
|
}
|
|
|
|
#endregion Conti correnti a saldo negativo
|
|
|
|
|
|
#region Linea Self a saldo negativo
|
|
|
|
|
|
// MIOFOGLIO 20181129
|
|
//AGGIUNGERE QUI LOGICA PER SEPARARE LE DUE TABELLE
|
|
|
|
|
|
if (area.ToUpper() == "SELF" && set.LineaSelf.Rows.Count > 0)
|
|
{
|
|
// 20181204 Per gestire lo spazio che bisogna lasciare per un'eventuale nota sul controvalore che va direttamente sotto la tabella area precedente
|
|
if (document.DocumentNotes.Rows.Count > 0 && !spazioNotaLasciato)
|
|
document.setLastPos(5);
|
|
|
|
set.LineaSelf.OrderBy(o => o.CodInterno);
|
|
float altezzaTabella = 0;
|
|
|
|
// 20181204 serve ad eliminare la nota finta, che altrimenti verrebbe stampata
|
|
document.Note.RemoveAt(0);
|
|
|
|
//--20181204
|
|
|
|
// GP ELIGO
|
|
var rows = set.Tables["LineaSelf"].AsEnumerable().Where<DataRow>(x => x.Field<string>("CodInterno").Equals("XY"));
|
|
|
|
if (rows.Any())
|
|
{
|
|
document.setTitolo("Liquidità negativa \"Linee GP Eligo\"");
|
|
|
|
datitab = new DatiTabella();
|
|
|
|
datitab.table = rows.CopyToDataTable();
|
|
datitab.CellClear();
|
|
|
|
Tabella TabLineaSelfGP = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
TabLineaSelfGP.HeaderFont = 8;
|
|
TabLineaSelfGP.Header = true;
|
|
TabLineaSelfGP.SaltoPagina = false;
|
|
TabLineaSelfGP.LineaFineTabella = false;
|
|
|
|
TabLineaSelfGP.Colonne.Add(new Colonna("DataSott", "Data Sott.", 80, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
TabLineaSelfGP.Colonne.Add(new Colonna("NumContratto", "Num. Contratto", 170, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
TabLineaSelfGP.Colonne.Add(new Colonna("NomeProdotto", "Nome", 162, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
TabLineaSelfGP.Colonne.Add(new Colonna("controvalore", "Controvalore (€)*", 100, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
|
|
// 20181204 Gestione nota, salvare informazione su tabella corrente
|
|
document.DocumentNotes.Rows.Add(string.Format("{0} - {1}", area, "GP"), 0, document.CurrentPage);
|
|
|
|
TabLineaSelfGP.DrawDiagnosi(datitab, document, notaSezione);
|
|
lastPosition = TabLineaSelfGP.AltezzaTabella;// +TabLineaSelf.AltezzaTabella;
|
|
|
|
// 20181204 Gestione nota, salvare informazione su tabella corrente
|
|
if (!string.IsNullOrEmpty(notaGradoCopertura))
|
|
{
|
|
document.AddDocumentNote(string.Format("{0} - {1}", area, "GP"), document.getLastPos() + lastPosition + 10, document.CurrentPage);
|
|
lastPosition += 10;
|
|
}
|
|
else
|
|
{
|
|
document.AddDocumentNote(string.Format("{0} - {1}", area, "GP"), document.getLastPos() + lastPosition, document.CurrentPage);
|
|
}
|
|
|
|
document.setLastPos(lastPosition);
|
|
altezzaTabella = lastPosition;
|
|
}
|
|
//--GP ELIGO
|
|
|
|
// IL MIO FOGLIO
|
|
rows = set.Tables["LineaSelf"].AsEnumerable().Where<DataRow>(x => x.Field<string>("CodInterno").Equals("FO"));
|
|
|
|
if (rows.Any())
|
|
{
|
|
document.setTitolo("Liquidità negativa \"Il Mio Foglio\"");
|
|
|
|
datitab = new DatiTabella();
|
|
|
|
datitab.table = rows.CopyToDataTable();
|
|
datitab.CellClear();
|
|
|
|
Tabella TabLineaSelfFO = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
TabLineaSelfFO.HeaderFont = 8;
|
|
TabLineaSelfFO.Header = true;
|
|
TabLineaSelfFO.SaltoPagina = false;
|
|
TabLineaSelfFO.LineaFineTabella = false;
|
|
|
|
TabLineaSelfFO.Colonne.Add(new Colonna("DataSott", "Data Sott.", 80, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
TabLineaSelfFO.Colonne.Add(new Colonna("NumContratto", "Num. Contratto", 170, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
TabLineaSelfFO.Colonne.Add(new Colonna("NomeProdotto", "Nome", 162, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
TabLineaSelfFO.Colonne.Add(new Colonna("controvalore", "Controvalore (€)*", 100, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
|
|
// 20181204 Gestione nota, salvare informazione su tabella corrente
|
|
document.DocumentNotes.Rows.Add(string.Format("{0} - {1}", area, "FO"), 0, document.CurrentPage);
|
|
|
|
TabLineaSelfFO.DrawDiagnosi(datitab, document, notaSezione);
|
|
lastPosition = altezzaTabella;// + TabLineaSelfFO.AltezzaTabella;// +TabLineaSelf.AltezzaTabella;
|
|
|
|
// 20181204 Gestione nota, salvare informazione su tabella corrente
|
|
if (!string.IsNullOrEmpty(notaGradoCopertura))
|
|
{
|
|
document.AddDocumentNote(string.Format("{0} - {1}", area, "FO"), document.getLastPos() + lastPosition + 10, document.CurrentPage);
|
|
lastPosition += 10;
|
|
}
|
|
else
|
|
{
|
|
document.AddDocumentNote(string.Format("{0} - {1}", area, "FO"), document.getLastPos() + lastPosition, document.CurrentPage);
|
|
}
|
|
|
|
document.setLastPos(lastPosition);
|
|
}
|
|
//--IL MIO FOGLIO
|
|
|
|
|
|
}
|
|
|
|
//-- MIOFOGLIO 20181129
|
|
|
|
|
|
|
|
//if (area.ToUpper() == "SELF" && set.LineaSelf.Rows.Count > 0)
|
|
//{
|
|
// document.setTitolo("Liquidità negativa \"Linee GP Eligo\"");
|
|
|
|
// datitab = new DatiTabella();
|
|
|
|
// datitab.table = set.Tables["LineaSelf"];
|
|
// datitab.CellClear();
|
|
|
|
// Tabella TabLineaSelf = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
// TabLineaSelf.HeaderFont = 8;
|
|
// TabLineaSelf.Header = true;
|
|
// TabLineaSelf.SaltoPagina = false;
|
|
|
|
// TabLineaSelf.Colonne.Add(new Colonna("DataSott", "Data Sott.", 80, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
// TabLineaSelf.Colonne.Add(new Colonna("NumContratto", "Num. Contratto", 170, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
// TabLineaSelf.Colonne.Add(new Colonna("NomeProdotto", "Nome", 162, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
// TabLineaSelf.Colonne.Add(new Colonna("controvalore", "Controvalore (€)", 100, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
|
|
|
|
// TabLineaSelf.DrawDiagnosi(datitab, document,notaSezione);
|
|
// lastPosition = TabLineaSelf.AltezzaTabella;// +TabLineaSelf.AltezzaTabella;
|
|
// document.setLastPos(lastPosition);
|
|
//}
|
|
|
|
#endregion Linea Self a saldo negativo
|
|
|
|
//MIFID2 20180419 da collocare dopo l'ultima tabella (o a fondo pagina)
|
|
//if (!moreTables)
|
|
//{
|
|
// if (!string.IsNullOrEmpty(notaSezione) && !notaSezioneStampata)
|
|
// {
|
|
// FormattedTextArea text = new FormattedTextArea(notaSezione, document.getMargineLeft(), document.getLastPos(), 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);
|
|
// notaSezioneStampata = true;
|
|
|
|
// lastPosition += 100;
|
|
// document.setLastPos(lastPosition);
|
|
// }
|
|
|
|
//}
|
|
//else
|
|
//{
|
|
// if (!string.IsNullOrEmpty(notaSezione) && !notaSezioneStampata)
|
|
// {
|
|
// FormattedTextArea text = new FormattedTextArea(notaSezione, document.getMargineLeft(), 700, 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);
|
|
// notaSezioneStampata = true;
|
|
// }
|
|
//}
|
|
|
|
|
|
//20180514
|
|
//float notaSezionePos;
|
|
//if (tableCount == 0)
|
|
//{
|
|
// notaSezionePos = document.getLastPos() - 30;
|
|
// document.setLastPos(lastPosition - 30);
|
|
//}
|
|
//else
|
|
// notaSezionePos = 700;
|
|
|
|
//if (!string.IsNullOrEmpty(notaSezione) && !notaSezioneStampata)
|
|
//{
|
|
// FormattedTextArea text = new FormattedTextArea(notaSezione, document.getMargineLeft(), notaSezionePos, 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);
|
|
// notaSezioneStampata = true;
|
|
//}
|
|
|
|
notaSezioneStampata = true;
|
|
if (tableCount == 0)
|
|
document.setLastPos(10);
|
|
|
|
//--MIFID2
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Disegna la tabella per Area Investimento
|
|
/// Se si ha più di 1 progetto, verrà aggiunta una riga, in grassetto, per ciascun progetto
|
|
/// come titolo del progetto d'investimento.
|
|
/// </summary>
|
|
/// <param name="datitab"></param>
|
|
/// <param name="document"></param>
|
|
/// <param name="area"></param>
|
|
private void writeAreaProgetto(DataThread dataThread, DatiTabella datitab, DocumentPDF document, string area)
|
|
{
|
|
|
|
bool checkPartiteViaggiantiCrossProgetto = false;
|
|
page = document.getCurrentPage();
|
|
float lastPosition = 0;
|
|
decimal totProgetto = 0;
|
|
string varProgetto = " ";
|
|
bool stampatatabellaTitoloProgetto = false;
|
|
float ytabella = 0; // unico incremento per la y di tutte le tabelle.
|
|
string notaGradoCopertura = string.Empty;
|
|
|
|
|
|
Tabella tabellaHeader = null;
|
|
Tabella tabellaTitoloProgetto = null;
|
|
Tabella tabellaDatiProgetto = null;
|
|
Tabella tabTotali = null;
|
|
|
|
|
|
//setta la datatable
|
|
datitab.table = set.Tables["ProdottiAreeBisogno"];
|
|
DataTable progetti = set.Tables["DettaglioProgetti"];
|
|
DataView view = new DataView(datitab.table);
|
|
DataView viewProgetti = new DataView(progetti);
|
|
|
|
view.RowFilter = ("CodiceAreaBisogno = '" + area + "'");
|
|
|
|
#region Tabella Header
|
|
tabellaHeader = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
tabellaHeader.HeaderFont = 8;
|
|
tabellaHeader.AltezzaCella = 30;
|
|
tabellaHeader.Header = true; // la gestione dell'header viene fatta manualmente.
|
|
tabellaHeader.SaltoPagina = false;
|
|
|
|
DataView viewHeader = new DataView(datitab.table);
|
|
viewHeader.RowFilter = ("CodiceAreaBisogno = 'xxx'");
|
|
datitab.table = viewHeader.ToTable();
|
|
datitab.table.Rows.Add(datitab.table.NewRow()); // serve per far scrivere l'intestazione.
|
|
|
|
int fontdim = 8;
|
|
|
|
//MIFID2 20180419 inserito asterisco alla colonna Controvalore
|
|
|
|
//tabellaHeader.Colonne.Add(new Colonna("DataSottoscrizione", "Data sott.", 60, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
////tabellaHeader.Colonne.Add(new Colonna("Descrizione", "Descrizione", 227, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaHeader.Colonne.Add(new Colonna("Descrizione", "Descrizione", 292, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaHeader.Colonne.Add(new Colonna("<IMAGE>", " ", 5, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaHeader.Colonne.Add(new Colonna("Controvalore", "Controvalore (€)", 90, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
////tabellaHeader.Colonne.Add(new Colonna("CreditRisk", "Rischio<BR>Credito", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
//tabellaHeader.Colonne.Add(new Colonna("Var", "Rischio<BR>(VaR %)", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
tabellaHeader.Colonne.Add(new Colonna("DataSottoscrizione", "Data sott.", 60, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaHeader.Colonne.Add(new Colonna("Descrizione", "Descrizione", 227, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
tabellaHeader.Colonne.Add(new Colonna("<IMAGE>", " ", 10, TipoAllineamento.DESTRA, false, fontdim, false, TipoColonna.IMMAGINE));
|
|
tabellaHeader.Colonne.Add(new Colonna("Descrizione", "Descrizione", 282, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
|
|
tabellaHeader.Colonne.Add(new Colonna("Controvalore", "Controvalore* (€)", 95, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
//tabellaHeader.Colonne.Add(new Colonna("CreditRisk", "Rischio<BR>Credito", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
tabellaHeader.Colonne.Add(new Colonna("Var", "Rischio<BR>(VaR %)", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
//--MIFID2
|
|
|
|
datitab.setCellSpace(0);
|
|
//Scrive la tabellaHeader
|
|
|
|
//MIFID2 20180601 Gestione nota, salvare informazione su tabella corrente
|
|
document.DocumentNotes.Rows.Add(area, 0, document.CurrentPage);
|
|
|
|
//tabellaDettaglio_Area.Draw(datitab, document, notaSezione, tableCount == 0, ref notaSezioneStampata);
|
|
tabellaHeader.DrawDiagnosi(datitab, document, notaSezione);
|
|
ytabella += tabellaHeader.AltezzaTabella;
|
|
|
|
//orig:
|
|
//tabellaHeader.Draw(datitab, document);
|
|
//ytabella += tabellaHeader.AltezzaTabella;
|
|
//--MIFID2
|
|
|
|
#endregion
|
|
|
|
// cicla sui progetti
|
|
int j = progetti.Rows.Count;
|
|
int iProgetti = 0; // contatore dei progetti
|
|
|
|
//Nota a piedi della tabella
|
|
// Imposto la nota a piedi della Tabella
|
|
DataView viewAreaInvestimento = new DataView(set.Tables["ProdottiAreeBisogno"]);
|
|
viewAreaInvestimento.RowFilter = "CodiceAreaBisogno= 'Inv'";
|
|
|
|
//MIFID2 20180619 Se il documento non ha nessuna nota nella lista di note, mi serve aggiungerne una "finta" per avere il numero di asterischi che parte da 2 (includendo la nota fissa sul Ctv)
|
|
if (document.Note.Count == 0)
|
|
document.Note.Add(new Nota(Nota.TipologiaNota.NonImpostato, "tabella_" + area, ""));
|
|
//--MIFID2
|
|
|
|
if (viewAreaInvestimento.Count > 0)
|
|
notaGradoCopertura = viewAreaInvestimento.ToTable().Rows[0]["Copertura"] == DBNull.Value ? string.Empty : viewAreaInvestimento.ToTable().Rows[0]["Copertura"].ToString();
|
|
|
|
if (notaGradoCopertura.Length > 0)
|
|
document.Note.Add(new Nota(Nota.TipologiaNota.GradoCopertura, "tabella_" + area, notaGradoCopertura));
|
|
|
|
////MIFID2 PROVA
|
|
//document.Note.Add(new Nota(Nota.TipologiaNota.NonImpostato, "tabella_" + area, notaSezione) { Posizionamento = Nota.TipologiaPosizionamento.NonImpostato });
|
|
////--MIFID2
|
|
|
|
//20180620 serve ad eliminare la nota finta, che altrimenti verrebbe stampata
|
|
document.Note.RemoveAt(0);
|
|
|
|
foreach (DataRow Row in progetti.Rows)
|
|
{
|
|
if (string.IsNullOrEmpty(_Progetto) || _Progetto == Row["NomeProgetto"].ToString())
|
|
{
|
|
totProgetto = Convert.ToDecimal(Row["Controvalore"]);
|
|
varProgetto = Row["Var"].ToString();
|
|
|
|
if (j > 0)
|
|
j--;
|
|
|
|
datitab.CellClear();
|
|
datitab.table = set.Tables["ProdottiAreeBisogno"];
|
|
view = new DataView(datitab.table);
|
|
view.RowFilter = ("CodiceAreaBisogno = '" + area + "'");
|
|
viewProgetti.RowFilter = ("NomeProgetto = '" + Row["NomeProgetto"].ToString().Replace("'", "''") + "'");
|
|
view.RowFilter = ("Progetto = '" + Row["NomeProgetto"].ToString().Replace("'", "''") + "'");
|
|
datitab.table = viewProgetti.ToTable();
|
|
|
|
// se il ctv del progetto investimento = 0 e VaR = n.c la tabella tabellaTitoloProgetto avrà solo la colonna "nomeProgetto"
|
|
decimal ctvProgettoInvestimento = Convert.ToDecimal(datitab.table.Compute("Sum(Controvalore)", "nomeProgetto = '" + Row["nomeprogetto"].ToString().Replace("'", "''") + "'"));
|
|
|
|
bool _mostraSoloNomeProgetto = false;
|
|
if (ctvProgettoInvestimento <= 0)
|
|
_mostraSoloNomeProgetto = true; // mostrerò solo la colonna "NomeProgetto" per i progetti che hanno ctv pari a 0
|
|
|
|
if (string.IsNullOrEmpty(_Progetto))
|
|
{
|
|
// TABELLA TITOLO DEL PROGETTO
|
|
tabellaTitoloProgetto = new Tabella(document.getMargineLeft(), document.getLastPos() + ytabella);
|
|
tabellaTitoloProgetto.HeaderFont = 8;
|
|
tabellaTitoloProgetto.Header = false;
|
|
tabellaTitoloProgetto.SaltoPagina = false;
|
|
tabellaTitoloProgetto.Datasource = datitab.table;
|
|
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI")
|
|
{
|
|
|
|
if (_mostraSoloNomeProgetto)
|
|
tabellaTitoloProgetto.Colonne.Add(new Colonna("nomeProgetto", "", 512, TipoAllineamento.SINISTRA, true, 8, false));
|
|
else
|
|
{
|
|
//tabellaTitoloProgetto.Colonne.Add(new Colonna("nomeProgetto", "", 300, TipoAllineamento.SINISTRA, true, 9, false));
|
|
//tabellaTitoloProgetto.Colonne.Add(new Colonna("Controvalore", "", 82, TipoAllineamento.DESTRA, true, 9, false));
|
|
//tabellaTitoloProgetto.Colonne.Add(new Colonna("Var", "", 128, TipoAllineamento.DESTRA, true, 9, false));
|
|
tabellaTitoloProgetto.Colonne.Add(new Colonna("nomeProgetto", "", 300, TipoAllineamento.SINISTRA, true, 9, false));
|
|
tabellaTitoloProgetto.Colonne.Add(new Colonna("Controvalore", "", 145, TipoAllineamento.DESTRA, true, 9, false));
|
|
tabellaTitoloProgetto.Colonne.Add(new Colonna("Var", "", 65, TipoAllineamento.DESTRA, true, 9, false));
|
|
}
|
|
|
|
|
|
}
|
|
|
|
datitab.setCellSpace(0);
|
|
datitab.setAlternRet();
|
|
|
|
tabellaTitoloProgetto.DrawDiagnosi(datitab, document, notaSezione);
|
|
ytabella += tabellaTitoloProgetto.AltezzaTabella;
|
|
stampatatabellaTitoloProgetto = true;
|
|
}
|
|
|
|
datitab.CellClear();
|
|
datitab.table = view.ToTable();
|
|
|
|
// TABELLA DATI PROGETTO.
|
|
//Tabella tabellaDatiProgetto;
|
|
tabellaDatiProgetto = new Tabella(document.getMargineLeft(), document.getLastPos() + ytabella);
|
|
tabellaDatiProgetto.HeaderFont = 8;
|
|
tabellaDatiProgetto.Datasource = datitab.table;
|
|
tabellaDatiProgetto.Header = false;
|
|
tabellaDatiProgetto.SaltoPaginaForzato = stampatatabellaTitoloProgetto;
|
|
tabellaDatiProgetto.Id = "tabella_" + area;
|
|
tabellaDatiProgetto.LineaFineTabella = true;
|
|
|
|
//EN 25012016 -nota alla fine del ultimo progetto
|
|
//if (notaGradoCopertura.Length > 0)
|
|
if ((notaGradoCopertura.Length > 0) && j == 0)
|
|
tabellaDatiProgetto.NotaTabella.Add(document.Note.Find(Nota.TipologiaNota.GradoCopertura, tabellaDatiProgetto.Id).Testo);
|
|
|
|
//MIFID2 20180419 inserito asterisco alla colonna Controvalore
|
|
|
|
//tabellaDatiProgetto.Colonne.Add(new Colonna("DataSottoscrizione", "Data sott.", 60, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
////tabellaDatiProgetto.Colonne.Add(new Colonna("Descrizione", "Descrizione", 227, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaDatiProgetto.Colonne.Add(new Colonna("Descrizione", "Descrizione", 292, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaDatiProgetto.Colonne.Add(new Colonna("<IMAGE>", " ", 5, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaDatiProgetto.Colonne.Add(new Colonna("Controvalore", "Controvalore (€)", 90, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
//// tabellaDatiProgetto.Colonne.Add(new Colonna("CreditRisk", "Rischio<BR>Credito", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
//tabellaDatiProgetto.Colonne.Add(new Colonna("Var", "Rischio<BR>(VaR %)", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
|
|
tabellaDatiProgetto.Colonne.Add(new Colonna("DataSottoscrizione", "Data sott.", 60, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaDatiProgetto.Colonne.Add(new Colonna("Descrizione", "Descrizione", 227, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
tabellaDatiProgetto.Colonne.Add(new Colonna("<IMAGE>", " ", 10, TipoAllineamento.DESTRA, false, fontdim, false, TipoColonna.IMMAGINE));
|
|
tabellaDatiProgetto.Colonne.Add(new Colonna("Descrizione", "Descrizione", 282, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
tabellaDatiProgetto.Colonne.Add(new Colonna("Controvalore", "Controvalore* (€)", 95, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
// tabellaDatiProgetto.Colonne.Add(new Colonna("CreditRisk", "Rischio<BR>Credito", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
tabellaDatiProgetto.Colonne.Add(new Colonna("Var", "Rischio<BR>(VaR %)", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
//--MIFID2
|
|
|
|
// scrivo la tabellaDatiProgetto
|
|
//MIFID2 20180514 chiamo la nuova Draw
|
|
//orig:
|
|
//tabellaDatiProgetto.Draw(datitab, document
|
|
|
|
//Se è l'ultima tabella della sezione tableCount == 0
|
|
tabellaDatiProgetto.DrawDiagnosi(datitab, document, notaSezione);
|
|
//--MIFID2
|
|
|
|
//20180514 COMMENTATO
|
|
//MIFID2 20180420 Serve per stampare la nota a piè pagina nelle pagine in cui viene splittata la tabella relativa agli investimenti
|
|
//int numPag = 1;
|
|
//foreach (var pag in tabellaDatiProgetto.PagineDisegnate)
|
|
//{
|
|
// //Nell'ultima pagina la nota va a fine tabella
|
|
// if (numPag < tabellaDatiProgetto.PagineDisegnate.Count)
|
|
// {
|
|
// FormattedTextArea text = new FormattedTextArea(notaSezione, document.getMargineLeft(), 700, 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;
|
|
// pag.Pagina.Elements.Add(text);
|
|
// }
|
|
// numPag++;
|
|
//}
|
|
//--MIFID2
|
|
//--20180514
|
|
|
|
////20180514 Se la nota è stata già stampata, ma c'è stato un salto di pagina, viene stampata anche sulla pagina corrente.
|
|
//if (notaSezioneStampata && tabellaDatiProgetto.SaltoPaginaEffettuato)
|
|
//{
|
|
// FormattedTextArea text = new FormattedTextArea(notaSezione, document.getMargineLeft(), 700, 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 = document.getCurrentPage();
|
|
// page.Elements.Add(text);
|
|
// notaSezioneStampata = true;
|
|
//}
|
|
|
|
|
|
checkPartiteViaggiantiCrossProgetto |= tabellaDatiProgetto.WithImage;
|
|
if (tabellaDatiProgetto.SaltoPaginaEffettuato)
|
|
ytabella = tabellaDatiProgetto.AltezzaCella;
|
|
|
|
ytabella += tabellaDatiProgetto.AltezzaTabella;
|
|
}
|
|
|
|
iProgetti++;
|
|
}
|
|
|
|
|
|
#region Scrivi Totale
|
|
|
|
|
|
datitab = new DatiTabella();
|
|
datitab.table = set.Tables["ProdottiTotale"];
|
|
datitab.CellClear();
|
|
|
|
DataView view2 = new DataView(datitab.table);
|
|
view2.RowFilter = ("CodiceAreaBisogno = '" + area + "'");
|
|
datitab.table = view2.ToTable();
|
|
|
|
//Imposto gli asterischi di rimando nel caso in cui sia presente la nota del grado copertura
|
|
if (notaGradoCopertura.Length > 0)
|
|
datitab.table.Rows[0]["Var"] = datitab.table.Rows[0]["Var"].ToString() + document.Note.Find(Nota.TipologiaNota.GradoCopertura, tabellaDatiProgetto.Id).ToString();
|
|
|
|
|
|
if (_Progetto != null)
|
|
{
|
|
//ASSEGNA I VALORI DEL SINGOLO PROGETTO ALLA TABELLA DEI TOTALI
|
|
datitab.table.Rows[0]["Totale"] = "TOTALE " + _Progetto.ToUpper();
|
|
datitab.table.Rows[0]["Controvalore"] = totProgetto;
|
|
datitab.table.Rows[0]["Var"] = varProgetto;
|
|
}
|
|
|
|
// TABELLA DEI TOTALI.
|
|
float yTabellaTotali;
|
|
if (tabellaDatiProgetto.SaltoPaginaEffettuato)
|
|
yTabellaTotali = tabellaDatiProgetto.AltezzaTabella;
|
|
else
|
|
yTabellaTotali = ytabella;
|
|
|
|
if (tabellaDatiProgetto.SaltoPaginaEffettuato)
|
|
yTabellaTotali += 25;
|
|
|
|
tabTotali = new Tabella(document.getMargineLeft(), document.getLastPos() + yTabellaTotali);
|
|
tabTotali.HeaderFont = 8;
|
|
tabTotali.Header = false;
|
|
tabTotali.SaltoPagina = false;
|
|
|
|
//tabTotali.Colonne.Add(new Colonna("Totale", string.Empty, 300, TipoAllineamento.SINISTRA, true, 8, true));
|
|
//tabTotali.Colonne.Add(new Colonna("Controvalore", string.Empty, 82, TipoAllineamento.DESTRA, true, 8, true));
|
|
//tabTotali.Colonne.Add(new Colonna("Var", string.Empty, 128, TipoAllineamento.DESTRA, true, 8, true));
|
|
|
|
tabTotali.Colonne.Add(new Colonna("Totale", string.Empty, 300, TipoAllineamento.SINISTRA, true, 8, true));
|
|
tabTotali.Colonne.Add(new Colonna("Controvalore", string.Empty, 145, TipoAllineamento.DESTRA, true, 8, true));
|
|
tabTotali.Colonne.Add(new Colonna("Var", string.Empty, 65, TipoAllineamento.DESTRA, true, 8, true));
|
|
|
|
|
|
/// disegna la tabella dei totali.
|
|
tabTotali.Draw(datitab, document);
|
|
lastPosition = yTabellaTotali;
|
|
|
|
//MIFID2 20180420
|
|
|
|
//MIFID2 20180601 DocumentNotes
|
|
// Memorizzare la posizione della nota e il numero pagina
|
|
// 20180619 se c'è la nota grado copertura bisogna aggiungere spazio
|
|
//document.AddDocumentNote(NomeArea, document.getLastPos() + lastPosition, document.CurrentPage);
|
|
|
|
if (!string.IsNullOrEmpty(notaGradoCopertura))
|
|
{
|
|
document.AddDocumentNote(area, document.getLastPos() + lastPosition + 10, document.CurrentPage);
|
|
document.setLastPos(lastPosition + 10);
|
|
}
|
|
else
|
|
{
|
|
document.AddDocumentNote(area, document.getLastPos() + lastPosition, document.CurrentPage);
|
|
document.setLastPos(lastPosition);
|
|
}
|
|
//--20180619 //--MIFID2
|
|
|
|
//document.setLastPos(lastPosition + 10);
|
|
|
|
//20180514
|
|
//float notaSezionePos;
|
|
//if (tableCount == 0)
|
|
//{
|
|
// notaSezionePos = document.getLastPos() - 30;
|
|
// document.setLastPos(lastPosition);
|
|
//}
|
|
//else
|
|
// notaSezionePos = 700;
|
|
|
|
//if (!string.IsNullOrEmpty(notaSezione) && !notaSezioneStampata)
|
|
//{
|
|
// FormattedTextArea text = new FormattedTextArea(notaSezione, document.getMargineLeft(), notaSezionePos, 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);
|
|
// notaSezioneStampata = true;
|
|
//}
|
|
|
|
////--MIFID2
|
|
|
|
//document.setLastPos(lastPosition + 50);
|
|
|
|
notaSezioneStampata = true;
|
|
|
|
//--MIFID2
|
|
|
|
#endregion
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Disegna la tabella per Area d'investimento
|
|
/// Usata per area Investimento nel report di monitoraggio
|
|
/// (ovvero quando il progetto d'investimento non è monitorato e si vuol stampare la S43 al posto della S43BIS)
|
|
/// </summary>
|
|
/// <param name="dataThread"></param>
|
|
/// <param name="datitab"></param>
|
|
/// <param name="document"></param>
|
|
/// <param name="area"></param>
|
|
private void writeAreaProgetto_Monitoraggio(DataThread dataThread, DatiTabella datitab, DocumentPDF document, string area)
|
|
{
|
|
|
|
FormatNum conv = new FormatNum();
|
|
float dim = 0;
|
|
string notaGradoCopertura = string.Empty;
|
|
|
|
page = document.getCurrentPage();
|
|
|
|
// decimal totProgetto = 0;
|
|
//string varProgetto = " ";
|
|
// bool stampatatabellaTitoloProgetto = false;
|
|
//float ytabella = 0; // unico incremento per la y di tutte le tabelle.
|
|
|
|
// Tabella tabellaDatiProgetto = null;
|
|
Tabella tabTotali = null;
|
|
|
|
|
|
//setta la datatable
|
|
datitab.table = set.Tables["ProdottiAreeBisogno"];
|
|
|
|
// filtro per l'area
|
|
DataView view = new DataView(datitab.table);
|
|
if (dataThread.Periodico)
|
|
view.RowFilter = ("OrdinamentoProgetto='" + _ordinamentoProgetto + "' and CodiceAreaBisogno = '" + dataThread.Area + "' and Progetto='" + dataThread.Progetto.Replace("'", "''") + "'");
|
|
else
|
|
view.RowFilter = ("'CodiceAreaBisogno = '" + dataThread.Area + "' and Progetto='" + dataThread.Progetto.Replace("'", "''") + "'");
|
|
datitab.table = view.ToTable();
|
|
|
|
|
|
if (datitab.table.Rows.Count > 0)
|
|
{
|
|
#region Tabella Dati
|
|
|
|
// Disegno la tabella
|
|
Tabella tabellaDettaglio_Area = new Tabella(document.getMargineLeft(), document.getLastPos());
|
|
tabellaDettaglio_Area.HeaderFont = 8;
|
|
tabellaDettaglio_Area.Header = true;
|
|
tabellaDettaglio_Area.Datasource = datitab.table;
|
|
tabellaDettaglio_Area.Id = "tabellaS43perMonitoraggio_" + area;
|
|
tabellaDettaglio_Area.LineaFineTabella = true;
|
|
|
|
#region Settaggio delle Note a piedi della tabella
|
|
|
|
//MIFID2 20180619 Se il documento non ha nessuna nota nella lista di note, mi serve aggiungerne una "finta" per avere il numero di asterischi che parte da 2 (includendo la nota fissa sul Ctv)
|
|
if (document.Note.Count == 0)
|
|
document.Note.Add(new Nota(Nota.TipologiaNota.NonImpostato, tabellaDettaglio_Area.Id, ""));
|
|
//--MIFID2
|
|
|
|
//Nota a piedi della tabella
|
|
// Imposto la nota a piedi della Tabella
|
|
notaGradoCopertura = datitab.table.Rows[0]["Copertura"] == DBNull.Value ? string.Empty : datitab.table.Rows[0]["Copertura"].ToString();
|
|
if (notaGradoCopertura.Length > 0)
|
|
{
|
|
document.Note.Add(new Nota(Nota.TipologiaNota.GradoCopertura, tabellaDettaglio_Area.Id, notaGradoCopertura));
|
|
tabellaDettaglio_Area.NotaTabella.Add(document.Note.Find(Nota.TipologiaNota.GradoCopertura, tabellaDettaglio_Area.Id).Testo);
|
|
}
|
|
|
|
//20180620 serve ad eliminare la nota finta, che altrimenti verrebbe stampata
|
|
document.Note.RemoveAt(0);
|
|
|
|
#endregion
|
|
|
|
int fontdim = 8;
|
|
tabellaDettaglio_Area.Colonne.Add(new Colonna("DataSottoscrizione", "Data sott.", 60, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
//tabellaDettaglio_Area.Colonne.Add(new Colonna("Descrizione", "Descrizione", 227, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
tabellaDettaglio_Area.Colonne.Add(new Colonna("<IMAGE>", " ", 10, TipoAllineamento.DESTRA, false, fontdim, false, TipoColonna.IMMAGINE));
|
|
tabellaDettaglio_Area.Colonne.Add(new Colonna("Descrizione", "Descrizione", 287, TipoAllineamento.SINISTRA, false, fontdim, false));
|
|
tabellaDettaglio_Area.Colonne.Add(new Colonna("Controvalore", "Controvalore (€)", 90, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
//tabellaDettaglio_Area.Colonne.Add(new Colonna("CreditRisk", "Rischio<BR>Credito", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
tabellaDettaglio_Area.Colonne.Add(new Colonna("Var", "Rischio<BR>(VaR %)", 65, TipoAllineamento.DESTRA, false, fontdim, false));
|
|
|
|
|
|
|
|
// Scrivo la tabella tabella Dati
|
|
tabellaDettaglio_Area.DrawDiagnosi(datitab, document, notaSezione);
|
|
#endregion Tabella Dati
|
|
|
|
#region Tabella Totale
|
|
|
|
datitab = new DatiTabella();
|
|
datitab.table = set.Tables["ProdottiTotale"];
|
|
datitab.CellClear();
|
|
|
|
DataView viewTotali = new DataView(datitab.table);
|
|
viewTotali.RowFilter = ("CodiceAreaBisogno = '" + area + "'");
|
|
datitab.table = viewTotali.ToTable();
|
|
|
|
|
|
|
|
//Imposto gli asterischi di rimando nel caso in cui sia presente la nota del grado copertura
|
|
if (notaGradoCopertura.Length > 0)
|
|
datitab.table.Rows[0]["Var"] = datitab.table.Rows[0]["Var"].ToString() + document.Note.Find(Nota.TipologiaNota.GradoCopertura, tabellaDettaglio_Area.Id).ToString();
|
|
|
|
|
|
// d.lisena.
|
|
// mi apsetto i dati in un datatable, li ritrovo in un altro. La Ds43 va rifatta da capo.
|
|
DataView viewDettaglioProgetti = new DataView(set.Tables["DettaglioProgetti"]);
|
|
if (dataThread.Periodico)
|
|
viewDettaglioProgetti.RowFilter = "OrdinamentoProgetto = '" + _ordinamentoProgetto + "'";
|
|
else
|
|
viewDettaglioProgetti.RowFilter = "NomeProgetto = '" + dataThread.Progetto.Replace("'", "''") + "'";
|
|
DataTable dtDettaglioProgetti = viewDettaglioProgetti.ToTable();
|
|
decimal controvaloreTotaleProgetto = Convert.ToDecimal(dtDettaglioProgetti.Rows[0]["Controvalore"]);
|
|
string varTotaleProgetto = dtDettaglioProgetti.Rows[0]["Var"].ToString();
|
|
|
|
|
|
// d.lisena.
|
|
// mi apsetto i dati in un datatable, li ritrovo in un altro. La Ds43 va rifatta da capo.
|
|
datitab.table.Rows[0]["Totale"] = "TOTALE " + dataThread.Progetto.ToUpper();
|
|
datitab.table.Rows[0]["Controvalore"] = controvaloreTotaleProgetto;
|
|
datitab.table.Rows[0]["Var"] = varTotaleProgetto;
|
|
|
|
|
|
tabTotali = new Tabella(document.getMargineLeft(), document.getLastPos() + tabellaDettaglio_Area.AltezzaTabella + 25);
|
|
tabTotali.HeaderFont = 8;
|
|
tabTotali.Header = false;
|
|
tabTotali.SaltoPagina = false;
|
|
|
|
tabTotali.Colonne.Add(new Colonna("Totale", string.Empty, 300, TipoAllineamento.SINISTRA, true, fontdim, true));
|
|
tabTotali.Colonne.Add(new Colonna("Controvalore", string.Empty, 82, TipoAllineamento.DESTRA, true, fontdim, true));
|
|
tabTotali.Colonne.Add(new Colonna("Var", string.Empty, 128, TipoAllineamento.DESTRA, true, fontdim, true));
|
|
|
|
|
|
/// disegna la tabella dei totali.
|
|
tabTotali.Draw(datitab, document);
|
|
|
|
dim = tabTotali.AltezzaTabella + tabellaDettaglio_Area.AltezzaTabella;
|
|
|
|
//tabellaDettaglio_Area.AddNotaPartiteViaggianti(dim, document);
|
|
document.setLastPos(dim);
|
|
|
|
#endregion
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Imposta o recupera l'area di bisogno per cui stampare la sezione.
|
|
/// Se non impostata stampa la sezione per tutte le aree/progetti
|
|
/// </summary>
|
|
public string Area
|
|
{
|
|
get
|
|
{
|
|
return _Area;
|
|
}
|
|
set
|
|
{
|
|
_Area = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Imposta o recupera il nome del progetto per cui stampare la sezione.
|
|
/// Se non impostata stampa la sezione per tutte le aree/progetti
|
|
/// </summary>
|
|
public string Progetto
|
|
{
|
|
get
|
|
{
|
|
return _Progetto;
|
|
}
|
|
set
|
|
{
|
|
_Progetto = value;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Imposta o recupera il titolo della sezione (es Riserva, Liquidità,Extra rendimento ... ).
|
|
/// Di default il titolo è preso dal database a meno che questa proprietà sia impostata e non sia impostata a true anche la MostraTitoloSezione.
|
|
/// </summary>
|
|
public string TitoloSezione
|
|
{
|
|
get { return _titolosezione; }
|
|
set { _titolosezione = value; }
|
|
}
|
|
|
|
}
|
|
}
|