Skip to content

Commit dc26fbd

Browse files
Condition content-disposition=inline; filename to reports only.
1 parent 780baa1 commit dc26fbd

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

dotnet/src/dotnetframework/GxClasses/Model/GXWebProcedure.cs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public class GXWebProcedure : GXHttpHandler
1818
protected IReportHandler oldReportHandler;
1919
string outputFileName;
2020
string outputType;
21-
bool fileContentInline;
2221

2322
protected int lineHeight;
2423
protected int Gx_line;
@@ -116,20 +115,17 @@ protected override void sendCacheHeaders()
116115

117116
private void setOuputFileName()
118117
{
119-
if (fileContentInline)
118+
string fileName = GetType().Name;
119+
string fileType = "pdf";
120+
if (!string.IsNullOrEmpty(outputFileName))
120121
{
121-
string fileName = GetType().Name;
122-
string fileType = "pdf";
123-
if (!string.IsNullOrEmpty(outputFileName))
124-
{
125-
fileName = outputFileName;
126-
}
127-
if (!string.IsNullOrEmpty(outputType))
128-
{
129-
fileType = outputType.ToLower();
130-
}
131-
context.HttpContext.Response.AddHeader(HttpHeader.CONTENT_DISPOSITION, $"inline; filename={fileName}.{fileType}");
122+
fileName = outputFileName;
123+
}
124+
if (!string.IsNullOrEmpty(outputType))
125+
{
126+
fileType = outputType.ToLower();
132127
}
128+
context.HttpContext.Response.AddHeader(HttpHeader.CONTENT_DISPOSITION, $"inline; filename={fileName}.{fileType}");
133129
}
134130

135131
public virtual int getOutputType()
@@ -141,7 +137,6 @@ protected bool initPrinter(String output, int gxXPage, int gxYPage, String iniFi
141137
string idiom;
142138
if (!Config.GetValueOf("LANGUAGE", out idiom))
143139
idiom = "eng";
144-
fileContentInline = true;
145140
#if NETCORE
146141
setOuputFileName();
147142
#endif

0 commit comments

Comments
 (0)