mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Merge pull request #3325 from okriuchykhin/ok_SCI_5709_v2
Fix table rendering in PDF reports [SCI-5709]
This commit is contained in:
commit
65004fa65f
2 changed files with 12 additions and 5 deletions
|
@ -8,12 +8,15 @@
|
|||
var input = el.siblings('input.hot-table-contents');
|
||||
var inputObj = JSON.parse(input.attr('value'));
|
||||
var data = inputObj.data;
|
||||
var headers;
|
||||
var parentEl;
|
||||
var order;
|
||||
|
||||
// Special handling if this is a repository table
|
||||
if (input.hasClass('hot-repository-items')) {
|
||||
let headers = inputObj.headers;
|
||||
let parentEl = el.closest('.report-module-repository-element');
|
||||
let order = parentEl.attr('data-order') === 'asc';
|
||||
headers = inputObj.headers;
|
||||
parentEl = el.closest('.report-module-repository-element');
|
||||
order = parentEl.attr('data-order') === 'asc';
|
||||
|
||||
el.handsontable({
|
||||
disableVisualSelection: true,
|
||||
|
|
|
@ -40,8 +40,12 @@ module Reports
|
|||
report = Report.find(report_id)
|
||||
file = Tempfile.new(['report', '.pdf'], binmode: true)
|
||||
begin
|
||||
template = Extends::REPORT_TEMPLATES[report.settings[:template]&.to_sym]
|
||||
template ||= Extends::REPORT_TEMPLATES.values.first
|
||||
template =
|
||||
if Extends::REPORT_TEMPLATES.key?(report.settings[:template]&.to_sym)
|
||||
report.settings[:template]
|
||||
else
|
||||
Extends::REPORT_TEMPLATES.keys.first
|
||||
end
|
||||
|
||||
raise StandardError, 'Report template not found!' if template.blank?
|
||||
|
||||
|
|
Loading…
Reference in a new issue