158 lines
6.6 KiB
C#
158 lines
6.6 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;
|
|
|
|
|
|
namespace PDFGenerator.Presentation.Section {
|
|
public class S75 : ISezione {
|
|
|
|
|
|
DatiTabella datitab;
|
|
|
|
public S75() {
|
|
//
|
|
// TODO: Add constructor logic here
|
|
//
|
|
}
|
|
|
|
#region ISezione Members
|
|
|
|
public void writeSezione(DataThread dataThread) {
|
|
DocumentPDF document = dataThread.DocumentPDF;
|
|
|
|
datitab = new DatiTabella();
|
|
DataSetS75 set = (DataSetS75)dataThread.Data.DatiSezione;
|
|
datitab.table = set.Tables["GradoCopertura"];
|
|
DataThread dsp = dataThread;
|
|
// controllo se esite un contocorrente aasociato
|
|
bool ccPresente = false;
|
|
foreach (DataRow r in datitab.table.Rows) {
|
|
if ((bool)r["ContoCorrentePresente"])
|
|
ccPresente = true;
|
|
}
|
|
|
|
//elimino la colonna ContoCorrentePresente in modo che nn viene stampata
|
|
datitab.table.Columns.Remove("ContoCorrentePresente");
|
|
|
|
DataView view = new DataView(datitab.table);
|
|
//datitab.table = view.ToTable(false, setTableForTable());
|
|
datitab.table = view.ToTable();
|
|
|
|
datitab.setY(document.getLastPos());
|
|
datitab.setIsLinee(1);
|
|
datitab.setHeader();
|
|
datitab.setIsRet();
|
|
datitab.setCell(135, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdana, false);
|
|
datitab.setCell(110, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false);
|
|
datitab.setCell(50, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false);
|
|
datitab.setCell(50, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false);
|
|
datitab.setCell(80, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false);
|
|
|
|
|
|
//eventuali operazioni sul dataset
|
|
//calcola se entra nella pagina altrimenti aggiunge una nuova pagina.
|
|
if (document.checkMargin(datitab.GetRowDim() * datitab.getNumRow()))
|
|
document.addPage();
|
|
|
|
//aggiorna l'indice
|
|
document.setSezTitolo(dataThread.SezioneReport.Titolo);
|
|
|
|
//document.page.Elements.Add(new ceTe.DynamicPDF.PageElements.Label(s, xMacroAsset + width, yLabel, (float)Convert.ToDouble(dati.campi[i]), heightLabel, (ceTe.DynamicPDF.Font)dati.font[i], fontSize, (ceTe.DynamicPDF.TextAlign)dati.align[i], ceTe.DynamicPDF.CmykColor.Black));
|
|
|
|
datitab.setY(document.getLastPos());
|
|
datitab.setX(document.getMargineLeft());
|
|
datitab.setCellSpace(0);
|
|
Tabella tab = new Tabella();
|
|
//setta posizione tabella
|
|
document.InsertTable(tab.getTabella(datitab));
|
|
|
|
this.writeMarker(document);
|
|
|
|
//aggiungo la nota
|
|
// d.lisena modifica punto 19
|
|
if (ccPresente) {
|
|
document.setSezFooter(Resource.S75_S75BIS_Nota, (datitab.getNumRow() + 1) * datitab.GetRowDim());
|
|
}
|
|
else
|
|
if (dsp.PartiteViaggiantiInvestimento + dsp.PartiteViaggiantiDisinvestimento != 0)
|
|
document.setSezFooter(Resource.S75_S75BIS_Nota, (datitab.getNumRow() + 1) * datitab.GetRowDim());
|
|
|
|
///// setto la posizione aggiornata
|
|
document.setLastPos((datitab.getNumRow() + 1) * datitab.GetRowDim());
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
private void writeMarker(DocumentPDF document) {
|
|
ceTe.DynamicPDF.Merger.ImportedPage page = document.getCurrentPage();
|
|
float y = datitab.GetRowDim();
|
|
//disegno i marker di riferimento per la S18
|
|
|
|
foreach (DataRow myRow in datitab.table.Rows) {
|
|
switch (myRow["Patrimonio"].ToString().Trim().ToUpper()) {
|
|
//FC 26062015 Aggionamento nuova Ragione Sociale
|
|
case "PATRIMONIO FIDEURAM":
|
|
//Marker 1
|
|
ceTe.DynamicPDF.PageElements.Rectangle rect = new ceTe.DynamicPDF.PageElements.Rectangle(document.getMargineLeft(), document.getLastPos() - 5 + y, 10 / 1.414F, 10 / 1.414F, 0, new RgbColor(0, 0, 0));
|
|
rect.Angle = 45;
|
|
page.Elements.Add(rect);
|
|
y += datitab.GetRowDim();
|
|
break;
|
|
|
|
case "PATRIMONIO SANPAOLO INVEST":
|
|
case "PATRIMONIO SAN PAOLO INVEST":
|
|
|
|
//Marker 1
|
|
rect = new ceTe.DynamicPDF.PageElements.Rectangle(document.getMargineLeft(), document.getLastPos() - 5 + y, 10 / 1.414F, 10 / 1.414F, 0, new RgbColor(0, 0, 0));
|
|
rect.Angle = 45;
|
|
page.Elements.Add(rect);
|
|
y += datitab.GetRowDim();
|
|
break;
|
|
|
|
case "Patrimonio IW Private Inv.": //cecco
|
|
|
|
//Marker 1
|
|
rect = new ceTe.DynamicPDF.PageElements.Rectangle(document.getMargineLeft(), document.getLastPos() - 5 + y, 10 / 1.414F, 10 / 1.414F, 0, new RgbColor(0, 0, 0));
|
|
rect.Angle = 45;
|
|
page.Elements.Add(rect);
|
|
y += datitab.GetRowDim();
|
|
break;
|
|
|
|
|
|
case "PATRIMONIO COMPLESSIVO":
|
|
//Marker 2
|
|
rect = new ceTe.DynamicPDF.PageElements.Rectangle(document.getMargineLeft() - 4, document.getLastPos() - 4 + y, 8, 8, 0, new RgbColor(0, 0, 0));
|
|
//rect.CornerRadius = 5;
|
|
page.Elements.Add(rect);
|
|
y += datitab.GetRowDim();
|
|
break;
|
|
|
|
case "PATRIMONIO ALTRI ISTITUTI":
|
|
//Marker 3
|
|
rect = new ceTe.DynamicPDF.PageElements.Rectangle(document.getMargineLeft() - 5, document.getLastPos() - 5 + y, 10, 10, 0, new RgbColor(0, 0, 0));
|
|
rect.CornerRadius = 5;
|
|
page.Elements.Add(rect);
|
|
y += datitab.GetRowDim();
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|