161 lines
7.8 KiB
C#
161 lines
7.8 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 ceTe.DynamicPDF.PageElements;
|
|
using ContrattoSei.Utilities;
|
|
namespace PDFGenerator.Presentation.Section {
|
|
public class S37 : ISezione {
|
|
|
|
|
|
public S37() {
|
|
//
|
|
// TODO: Add constructor logic here
|
|
//
|
|
}
|
|
|
|
#region ISezione Members
|
|
|
|
public void writeSezione(DataThread dataThread) {
|
|
DocumentPDF document = dataThread.DocumentPDF;
|
|
DatiTabella datitab = new DatiTabella();
|
|
//setta la datatable
|
|
DataSetS37 set = (DataSetS37)dataThread.Data.DatiSezione;
|
|
|
|
datitab.table = set.Tables["AreeBisogno"];
|
|
|
|
//eventuali operazioni sul dataset
|
|
|
|
//calcola se entra nella pagina altrimenti aggiunge una nuova pagina. In questa sezione il # di righe è fissato
|
|
//devo considerare lo spazio dell'header- ora lo aggiungo manualmente (130)
|
|
if (document.checkMargin(datitab.GetRowDim() * datitab.getNumRow() + 130)) document.addPage();
|
|
|
|
//aggiorna l'indice, titolo e header sezione
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI")
|
|
document.setSezTitoloDiagnosi(dataThread.SezioneReport.Titolo);
|
|
else
|
|
document.setSezTitolo(dataThread.SezioneReport.Titolo);
|
|
document.setSezHeader(dataThread.SezioneReport.TestoIntroduttivo);
|
|
//setto un margine tra l'header e la tabella
|
|
document.setHeaderSpace(5);
|
|
|
|
//settaggi dell'oggetto tabella
|
|
datitab.setX(200);
|
|
datitab.setCellSpace(0);
|
|
datitab.setY(document.getLastPos());
|
|
datitab.setHeader();
|
|
datitab.SetRowDim(30);
|
|
datitab.setCell(70, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false);
|
|
|
|
Tabella tab = new Tabella();
|
|
if (dataThread.TipoReport.ToUpper() == "DIAGNOSI") tab.HeaderFont = 8;
|
|
//setta posizione tabella
|
|
document.InsertTable(tab.getTabella(datitab));
|
|
|
|
ceTe.DynamicPDF.Merger.ImportedPage page = document.getCurrentPage();
|
|
|
|
page.Elements.Add(new ceTe.DynamicPDF.PageElements.Rectangle(document.getMargineLeft() - 5, document.getLastPos() + 30 * 6 - 10, 240, 23, 0, new RgbColor(232, 236, 237)));
|
|
page.Elements.Add(new ceTe.DynamicPDF.PageElements.Label("TOTALE 100,00", document.getMargineLeft() + 5, document.getLastPos() + 30 * 6 - 5, 300, 10, Globals.OpenTypeFontVerdanaB, 9, ceTe.DynamicPDF.CmykColor.Black));
|
|
|
|
datitab = new DatiTabella();
|
|
datitab.table = set.Tables["Investimenti"];
|
|
|
|
if (datitab.table.Rows.Count > 0) {
|
|
datitab.setY(document.getLastPos());
|
|
float x = 335;
|
|
float y = document.getLastPos() + 25;
|
|
datitab.setHeader();
|
|
datitab.setCell(105, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdana, false);
|
|
datitab.setCell(35, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false);
|
|
datitab.setCell(70, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, false);
|
|
datitab.setX(x);
|
|
datitab.setY(y);
|
|
document.InsertTable(tab.getTabella(datitab));
|
|
|
|
float dim = datitab.GetRowDim() * (datitab.getNumRow() + 1);
|
|
|
|
datitab = new DatiTabella();
|
|
datitab.table = set.Tables["TotaleConti"];
|
|
|
|
datitab.setX(x);
|
|
datitab.setY(y + dim);
|
|
datitab.setCell(105, ceTe.DynamicPDF.TextAlign.Left, Globals.OpenTypeFontVerdanaB, true, 8);
|
|
datitab.setCell(35, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdanaB, true, 8);
|
|
datitab.setCell(70, ceTe.DynamicPDF.TextAlign.Right, Globals.OpenTypeFontVerdana, true, 8);
|
|
|
|
document.InsertTable(tab.getTabella(datitab));
|
|
dim -= 15;
|
|
|
|
//spessore bordo tabella
|
|
int spes = 10;
|
|
|
|
string relativePath = UtilityManager.getAppSetting("ArrowBorder");
|
|
System.Reflection.Assembly thisExe;
|
|
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
|
|
System.IO.Stream file = thisExe.GetManifestResourceStream(relativePath);
|
|
|
|
|
|
page.Elements.Add(new ceTe.DynamicPDF.PageElements.Line(x - spes, y - 5 - spes, x + 70 + 50 + 90 + spes, y - 5 - spes, 1));
|
|
page.Elements.Add(new ceTe.DynamicPDF.PageElements.Line(x - spes, y + datitab.GetRowDim() * datitab.getNumRow() + spes + dim, x + 70 + 50 + 90 + spes, y + datitab.GetRowDim() * datitab.getNumRow() + spes + dim, 1));
|
|
page.Elements.Add(new ceTe.DynamicPDF.PageElements.Line(x - spes, y - 5 - spes, x - spes, y + datitab.GetRowDim() * datitab.getNumRow() + spes + dim, 1));
|
|
page.Elements.Add(new ceTe.DynamicPDF.PageElements.Line(x + 70 + 50 + 90 + spes, y - 5 - spes, x + 70 + 50 + 90 + spes, y + datitab.GetRowDim() * datitab.getNumRow() + spes + dim, 1));
|
|
|
|
float x_s = 283.5F;
|
|
float y_s = document.getLastPos() + 45;
|
|
|
|
//riga bianca
|
|
page.Elements.Add(new Line(x_s + 41.5F, y_s + 11, x_s + 41.5F, y_s + 18,RgbColor.White));
|
|
|
|
//FRECCIA
|
|
//linee orizzontali
|
|
page.Elements.Add(new Line(x_s + 42F,y_s + 11,x_s+29.50F,y_s + 11F));
|
|
page.Elements.Add(new Line(x_s + 42F, y_s + 18F, x_s + 29.50F, y_s + 18F));
|
|
//linee Verticali
|
|
page.Elements.Add(new Line(x_s + 30, y_s + 11, x_s + 30, y_s + 1));
|
|
page.Elements.Add(new Line(x_s + 30, y_s + 18, x_s + 30, y_s + 28.5F));
|
|
//linee oblique
|
|
page.Elements.Add(new Line(x_s - 0.00F, y_s + 16.5F, x_s + 31.35F, y_s));
|
|
page.Elements.Add(new Line(x_s - 0.00F, y_s + 14.5F, x_s + 31.35F, y_s + 29.5F));
|
|
//page.Elements.Add(new ceTe.DynamicPDF.PageElements.Image(file, 283.5F, document.getLastPos() + 45, 1));
|
|
|
|
//Copertura punta
|
|
Rectangle r_d = new Rectangle(x_s - 1.1F, y_s + 15.12F, 4.4F, 4.5F, RgbColor.White, RgbColor.White);
|
|
r_d.Angle = 25.0F; //25.5 R:x_s - 1.1F, y_s + 15.10F
|
|
//r_d.BorderWidth = 0.1F;
|
|
Rectangle r_u = new Rectangle(x_s + 2.6F, y_s + 14.0F, 4, 4, RgbColor.White, RgbColor.White);
|
|
r_u.Angle = 151;
|
|
page.Elements.Add(r_d);
|
|
page.Elements.Add(r_u);
|
|
|
|
//Copertura code
|
|
Rectangle r_c_u = new Rectangle(x_s + 31.00F, y_s, 4, 4, RgbColor.White, RgbColor.White);
|
|
page.Elements.Add(r_c_u);
|
|
Rectangle r_c_d = new Rectangle(x_s + 31.00F, y_s + 28.5F, 4, 4, RgbColor.White, RgbColor.White);
|
|
page.Elements.Add(r_c_d);
|
|
//page.Elements.Add(new ceTe.DynamicPDF.PageElements.Label("100,00", document.getMargineLeft() + 175, yLabel, 100, heightLabel, Font.HelveticaBold, fontSize, ceTe.DynamicPDF.TextAlign.Left, ceTe.DynamicPDF.CmykColor.Black));
|
|
|
|
//document.InsertTable(tab.getTabella(datitab));
|
|
}
|
|
|
|
Piramide modello = new Piramide();
|
|
modello.writeSezione(document);
|
|
|
|
//devo considerare lo spazio dell'header- ora lo aggiungo manualmente
|
|
document.setLastPos(datitab.GetRowDim() * 6 + 60);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|