Resize text
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kamonwan taengsuk
2024-09-18 12:16:42 +07:00
parent 84e8167aca
commit 8e237bbb5b
13 changed files with 37 additions and 55 deletions

View File

@@ -30,25 +30,7 @@ namespace rmutr_report.Controllers
public IActionResult GetHrReport([FromRoute] string type,
[FromBody] durable_articles_three durable_articles_threes)
{
//Console.WriteLine(durable_articles_threes.specification_data[0].data_detail[0].data_detail2);
// var a1 = durable_articles_threes.data.Sum(o => o.amount);
// if (durable_articles_threes.data!=null)
// {
// durable_articles_threes.total_amount = a1;
//
// }
// int a = 1;
// foreach (var q in durable_articles_threes.quotation)
// {
//
// string t = "ใบเสนอราคาบริษัทที่ " + a++ +" ";
// q.company = t + q.company;
// //a++;
// }
var _durable_articles_three = new List<durable_articles_three>() { durable_articles_threes };
var _durable_articles_three = new List<durable_articles_three>() { durable_articles_threes };
Report report = new Report();
report.Load(_setting.report_path + "durable_articles_three.frx");
@@ -96,20 +78,20 @@ namespace rmutr_report.Controllers
report.Export(excelExport, stream);
stream.Seek(0, SeekOrigin.Begin);
using (var package = new ExcelPackage(stream))
{
ExcelWorksheet worksheet = package.Workbook.Worksheets[0];
if (worksheet.Dimension != null)
{
//worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
worksheet.Cells[worksheet.Dimension.Address].Style.WrapText = true;
}
package.Save();
}
stream.Seek(0, SeekOrigin.Begin);
// using (var package = new ExcelPackage(stream))
// {
// ExcelWorksheet worksheet = package.Workbook.Worksheets[0];
//
// if (worksheet.Dimension != null)
// {
// //worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
// worksheet.Cells[worksheet.Dimension.Address].Style.WrapText = true;
// }
//
// package.Save();
// }
//
// stream.Seek(0, SeekOrigin.Begin);
return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
}