-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReportFeature.cs
51 lines (45 loc) · 1.37 KB
/
ReportFeature.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using Microsoft.AspNetCore.Http;
using System;
namespace z.Report
{
public class ReportFeature : IReportFeature
{
public ReportFeature(HttpContext context)
{
RenderRequest = new RenderRequest();
Context = context;
Enabled = true;
Base64Content = false;
}
public RenderRequest RenderRequest { get; set; }
public bool Enabled { get; private set; }
public HttpContext Context { get; set; }
public bool Base64Content { get; private set; }
public bool Base64AppendString { get; private set; }
public IReportFeature Configure(Action<RenderRequest> req)
{
req.Invoke(RenderRequest);
return this;
}
public IReportFeature Base64(bool appendBase64Prefix = true)
{
Base64Content = true;
Base64AppendString = appendBase64Prefix;
return this;
}
public IReportFeature Landscape()
{
RenderRequest.Options.PageOrientation = Options.Orientation.Landscape;
return this;
}
/// <summary>
/// This Option will disable the pdf rendering
/// </summary>
/// <returns></returns>
public IReportFeature Disabled()
{
Enabled = false;
return this;
}
}
}