Inserito controllo completamento merge pdf (numero fatti/totale)
This commit is contained in:
@@ -90,8 +90,8 @@
|
||||
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\StackExchange.Redis.2.0.601\lib\net461\StackExchange.Redis.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SteamWare, Version=3.5.1911.699, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.3.5.1911.699\lib\net462\SteamWare.dll</HintPath>
|
||||
<Reference Include="SteamWare, Version=3.5.1911.700, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.3.5.1911.700\lib\net462\SteamWare.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<package id="SharpZipLib" version="1.2.0" targetFramework="net462" />
|
||||
<package id="Snappy.NET" version="1.1.1.8" targetFramework="net462" />
|
||||
<package id="StackExchange.Redis" version="2.0.601" targetFramework="net462" />
|
||||
<package id="SteamWare" version="3.5.1911.699" targetFramework="net462" />
|
||||
<package id="SteamWare" version="3.5.1911.700" targetFramework="net462" />
|
||||
<package id="System.Buffers" version="4.5.0" targetFramework="net462" />
|
||||
<package id="System.Diagnostics.PerformanceCounter" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.IO.Pipelines" version="4.6.0" targetFramework="net462" />
|
||||
|
||||
@@ -179,8 +179,8 @@
|
||||
<Reference Include="StackExchange.Redis.StrongName, Version=1.2.6.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\StackExchange.Redis.StrongName.1.2.6\lib\net46\StackExchange.Redis.StrongName.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SteamWare, Version=3.5.1911.699, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.3.5.1911.699\lib\net462\SteamWare.dll</HintPath>
|
||||
<Reference Include="SteamWare, Version=3.5.1911.700, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.3.5.1911.700\lib\net462\SteamWare.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<asp:HiddenField runat="server" ID="hfIdxDossier" />
|
||||
<asp:LinkButton runat="server" ID="lbtExportWithAttach" CssClass="btn btn-sm btn-warning btn-block" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaReportCompletoAllegati") %>' OnClick="lbtExportWithAttach_Click"><%: traduci("PrepareReportCompletoAllegati") %> <i class="fa fa-gears" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:HyperLink runat="server" ID="hlDownloadPdf" Target="_blank" Visible="false" CssClass="btn btn-sm btn-success btn-block"><%: traduci("DownloadReportCompletoAllegati") %> <i class="fa fa-download" aria-hidden="true"></i></asp:HyperLink>
|
||||
<asp:Label runat="server" ID="lblOutMessage" CssClass="text-danger" Visible="false"></asp:Label>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<b>Fase</b>
|
||||
|
||||
@@ -128,6 +128,9 @@ namespace CMS_SC
|
||||
/// <param name="e"></param>
|
||||
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();
|
||||
}
|
||||
|
||||
Generated
+9
@@ -41,6 +41,15 @@ namespace CMS_SC
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlDownloadPdf;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblOutMessage.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblOutMessage;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ddlFase.
|
||||
/// </summary>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<package id="Snappy.NET" version="1.1.1.8" targetFramework="net462" />
|
||||
<package id="StackExchange.Redis" version="2.0.601" targetFramework="net462" />
|
||||
<package id="StackExchange.Redis.StrongName" version="1.2.6" targetFramework="net462" />
|
||||
<package id="SteamWare" version="3.5.1911.699" targetFramework="net462" />
|
||||
<package id="SteamWare" version="3.5.1911.700" targetFramework="net462" />
|
||||
<package id="System.Buffers" version="4.5.0" targetFramework="net462" />
|
||||
<package id="System.Diagnostics.PerformanceCounter" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.IO.Pipelines" version="4.6.0" targetFramework="net462" />
|
||||
|
||||
Reference in New Issue
Block a user