Skip to content

Commit

Permalink
Condition content-disposition=inline; filename to reports only.
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiamurialdo committed Jun 7, 2023
1 parent 780baa1 commit dc26fbd
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions dotnet/src/dotnetframework/GxClasses/Model/GXWebProcedure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class GXWebProcedure : GXHttpHandler
protected IReportHandler oldReportHandler;
string outputFileName;
string outputType;
bool fileContentInline;

protected int lineHeight;
protected int Gx_line;
Expand Down Expand Up @@ -116,20 +115,17 @@ protected override void sendCacheHeaders()

private void setOuputFileName()
{
if (fileContentInline)
string fileName = GetType().Name;
string fileType = "pdf";
if (!string.IsNullOrEmpty(outputFileName))
{
string fileName = GetType().Name;
string fileType = "pdf";
if (!string.IsNullOrEmpty(outputFileName))
{
fileName = outputFileName;
}
if (!string.IsNullOrEmpty(outputType))
{
fileType = outputType.ToLower();
}
context.HttpContext.Response.AddHeader(HttpHeader.CONTENT_DISPOSITION, $"inline; filename={fileName}.{fileType}");
fileName = outputFileName;
}
if (!string.IsNullOrEmpty(outputType))
{
fileType = outputType.ToLower();
}
context.HttpContext.Response.AddHeader(HttpHeader.CONTENT_DISPOSITION, $"inline; filename={fileName}.{fileType}");
}

public virtual int getOutputType()
Expand All @@ -141,7 +137,6 @@ protected bool initPrinter(String output, int gxXPage, int gxYPage, String iniFi
string idiom;
if (!Config.GetValueOf("LANGUAGE", out idiom))
idiom = "eng";
fileContentInline = true;
#if NETCORE
setOuputFileName();
#endif
Expand Down

0 comments on commit dc26fbd

Please sign in to comment.