Skip to content

Commit ff2432b

Browse files
Condition content-disposition=inline; filename to reports only. (#826)
1 parent bc32f1c commit ff2432b

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

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

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class GXWebProcedure : GXHttpHandler
2626
protected IReportHandler oldReportHandler;
2727
string outputFileName;
2828
string outputType;
29+
bool fileContentInline;
2930

3031
protected int lineHeight;
3132
protected int Gx_line;
@@ -129,18 +130,21 @@ protected override void sendCacheHeaders()
129130

130131
private void setOuputFileName()
131132
{
132-
string fileName = GetType().Name;
133-
string fileType = "pdf";
134-
if (!string.IsNullOrEmpty(outputFileName))
133+
if (fileContentInline)
135134
{
136-
fileName = outputFileName;
137-
}
138-
if (!string.IsNullOrEmpty(outputType))
139-
{
140-
fileType = outputType.ToLower();
141-
}
135+
string fileName = GetType().Name;
136+
string fileType = "pdf";
137+
if (!string.IsNullOrEmpty(outputFileName))
138+
{
139+
fileName = outputFileName;
140+
}
141+
if (!string.IsNullOrEmpty(outputType))
142+
{
143+
fileType = outputType.ToLower();
144+
}
142145

143-
context.HttpContext.Response.AddHeader(HttpHeader.CONTENT_DISPOSITION, $"inline; filename={fileName}.{fileType}");
146+
context.HttpContext.Response.AddHeader(HttpHeader.CONTENT_DISPOSITION, $"inline; filename={fileName}.{fileType}");
147+
}
144148
}
145149

146150
public virtual int getOutputType()
@@ -152,6 +156,7 @@ protected bool initPrinter(String output, int gxXPage, int gxYPage, String iniFi
152156
string idiom;
153157
if (!Config.GetValueOf("LANGUAGE", out idiom))
154158
idiom = "eng";
159+
fileContentInline = true;
155160
#if NETCORE
156161
setOuputFileName();
157162
#endif

0 commit comments

Comments
 (0)