Fase
diff --git a/CMS_SC/ReportCompleto.aspx.cs b/CMS_SC/ReportCompleto.aspx.cs
index aead090..2e739ee 100644
--- a/CMS_SC/ReportCompleto.aspx.cs
+++ b/CMS_SC/ReportCompleto.aspx.cs
@@ -128,6 +128,9 @@ namespace CMS_SC
///
protected void lbtExportWithAttach_Click(object sender, EventArgs e)
{
+ bool allDone = false;
+ int numFilesDone = 0;
+ int allFiles = 0;
// effettua merge Report Completo + allegati: registro in primis la richiesta!
var tabDoss = DtProxy.man.taED.getByDossier(idxDossier);
if (tabDoss.Count > 0)
@@ -154,20 +157,40 @@ namespace CMS_SC
foreach (var item in tabDati)
{
pdfInFullPath = "";
- if (!elencoPdf.Contains(item.Path))
+ // controllo SE HO un pdf...
+ if (!string.IsNullOrEmpty(item.Path))
{
- pdfInFullPath = Server.MapPath(string.Format(urlSchede, item.Path));
- elencoPdf.Add(pdfInFullPath);
+ allFiles++;
+ try
+ {
+ if (!elencoPdf.Contains(item.Path))
+ {
+
+ pdfInFullPath = Server.MapPath(string.Format(urlSchede, item.Path));
+ elencoPdf.Add(pdfInFullPath);
+ }
+ }
+ catch
+ { }
}
}
// step 4: MERGE di tutti i pdf nel file di output
string outFilePath = $"ReportAndSpec_{idxDossier}.pdf";
string outFilePathMapped = $"{Server.MapPath(currOutPath)}\\{outFilePath}";
- SteamWare.pdfUtils.mergePdfFiles(outFilePathMapped, elencoPdf);
+ numFilesDone = pdfUtils.mergePdfFiles(outFilePathMapped, elencoPdf);
+ allDone = (numFilesDone == allFiles && allFiles > 0);
// step 5: chiamo pagina x download nuovo file composto... aggiornando hyperLink button x scaricare in target "_blank" il report creato...
- lbtExportWithAttach.Visible = false;
- hlDownloadPdf.Visible = true;
- hlDownloadPdf.NavigateUrl = $"downloadReport?baseDir={currOutPath}&fileName={outFilePath}&cType=pdf";
+ lbtExportWithAttach.Visible = !allDone;
+ hlDownloadPdf.Visible = allDone;
+ lblOutMessage.Visible = !allDone;
+ if (allDone)
+ {
+ hlDownloadPdf.NavigateUrl = $"downloadReport?baseDir={currOutPath}&fileName={outFilePath}&cType=pdf";
+ }
+ else
+ {
+ lblOutMessage.Text = $"Attenzione: non รจ stato possibile trovare tutti i files richiesti({numFilesDone}/{allFiles}), verificare i pdf";
+ }
// refresh finale report mostrato (ho usaro reportviewer x export pdf...)
fixSelReport();
}
diff --git a/CMS_SC/ReportCompleto.aspx.designer.cs b/CMS_SC/ReportCompleto.aspx.designer.cs
index 3366bd6..5b13158 100644
--- a/CMS_SC/ReportCompleto.aspx.designer.cs
+++ b/CMS_SC/ReportCompleto.aspx.designer.cs
@@ -41,6 +41,15 @@ namespace CMS_SC
///
protected global::System.Web.UI.WebControls.HyperLink hlDownloadPdf;
+ ///
+ /// Controllo lblOutMessage.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblOutMessage;
+
///
/// Controllo ddlFase.
///
diff --git a/CMS_SC/packages.config b/CMS_SC/packages.config
index 4cdbc58..d4663da 100644
--- a/CMS_SC/packages.config
+++ b/CMS_SC/packages.config
@@ -52,7 +52,7 @@
-
+