แก้ไขการ export docx และ xlsx
This commit is contained in:
parent
160ff2abcf
commit
a32165d172
2 changed files with 4 additions and 1 deletions
|
|
@ -41,6 +41,7 @@
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
|
||||||
<PackageReference Include="Telerik.Reporting" Version="17.1.23.718" />
|
<PackageReference Include="Telerik.Reporting" Version="17.1.23.718" />
|
||||||
|
<PackageReference Include="Telerik.Reporting.OpenXmlRendering" Version="17.1.23.718" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,8 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
report.DataSource = command;
|
report.DataSource = command;
|
||||||
|
|
||||||
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
|
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
|
||||||
|
if(exportType == "docx")
|
||||||
|
deviceInfo["OutputFormat"] = "DOCX";
|
||||||
|
|
||||||
InstanceReportSource instanceReportSource = new InstanceReportSource()
|
InstanceReportSource instanceReportSource = new InstanceReportSource()
|
||||||
{
|
{
|
||||||
|
|
@ -95,7 +97,7 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
|
|
||||||
|
|
||||||
ReportProcessor reportProcessor = new ReportProcessor(_configuration);
|
ReportProcessor reportProcessor = new ReportProcessor(_configuration);
|
||||||
RenderingResult result = reportProcessor.RenderReport(exportType, instanceReportSource, deviceInfo);
|
RenderingResult result = reportProcessor.RenderReport(exportType.ToUpper(), instanceReportSource, deviceInfo);
|
||||||
|
|
||||||
var content = result.DocumentBytes;
|
var content = result.DocumentBytes;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue