fix controllo path x salvataggio report
This commit is contained in:
@@ -84,6 +84,7 @@ namespace CMS_SC.WebUserControls
|
||||
/// <param name="outFilePath">Nome del file per salvataggio report</param>
|
||||
public void printReport(string outFilePath)
|
||||
{
|
||||
logger.lg.scriviLog($"Inizio printReport da {ReportCMS.LocalReport.ReportPath}");
|
||||
LocalReport localReport = ReportCMS.LocalReport;
|
||||
Warning[] warnings;
|
||||
string[] streamIds;
|
||||
@@ -94,12 +95,22 @@ namespace CMS_SC.WebUserControls
|
||||
if (TipoReport != "" && IdxDossier > 0)
|
||||
{
|
||||
byte[] bytes = localReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
|
||||
string FilePath = Server.MapPath(outFilePath);
|
||||
// se è un percorso virtuale faccio mapPath...
|
||||
string FilePath = "";
|
||||
if (outFilePath.IndexOf("/") >= 0)
|
||||
{
|
||||
FilePath = Server.MapPath(outFilePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
FilePath = outFilePath;
|
||||
}
|
||||
using (FileStream fs = new FileStream(FilePath, FileMode.Create))
|
||||
{
|
||||
fs.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
}
|
||||
logger.lg.scriviLog($"Effettuato printReport di {outFilePath}");
|
||||
}
|
||||
/// <summary>
|
||||
/// wrapper traduzione
|
||||
|
||||
Reference in New Issue
Block a user