Skip to content

Commit 3d38195

Browse files
authored
Merge pull request #509 from FastReports/sync_branch_2022.3.15
FastReport.OpenSource 2022.3.15
2 parents e1d95a1 + c4bd1b3 commit 3d38195

File tree

15 files changed

+1091
-1114
lines changed

15 files changed

+1091
-1114
lines changed

FastReport.Base/Export/Html/HTMLExportLayers.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ private void LayerText(FastString Page, TextObject obj)
322322
{
323323
top = obj.Height - htmlTextRenderer.CalcHeight();
324324
}
325-
FastString sb = GetHtmlParagraph(htmlTextRenderer);
325+
FastString sb = GetHtmlParagraph(htmlTextRenderer, obj.Left);
326326

327327
LayerBack(Page, obj,
328328
GetSpanText(obj, sb,
@@ -391,7 +391,7 @@ private void LayerText(FastString Page, TextObject obj)
391391

392392
}
393393

394-
private FastString GetHtmlParagraph(HtmlTextRenderer renderer)
394+
private FastString GetHtmlParagraph(HtmlTextRenderer renderer, float Left)
395395
{
396396
FastString sb = new FastString();
397397

@@ -492,9 +492,8 @@ private FastString GetHtmlParagraph(HtmlTextRenderer renderer)
492492

493493
}
494494
}
495-
496495
}
497-
prevWidth += run.Width;
496+
prevWidth = run.Left + run.Width - Left;
498497
//run.ToHtml(sb, true);
499498
}
500499
}

FastReport.Core.Web/Templates/ExportSettings/DocxExportSettings.cs

Lines changed: 93 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -19,111 +19,108 @@ internal string template_DocxExportSettings()
1919
var localizationPageSelector = new PageSelectorLocalization(Res);
2020

2121
return $@"
22-
<div class=""modalcontainer modalcontainer--3"" data-target=""docx"">
23-
<div class=""fr-webreport-popup-content-export-parameters"">
24-
<div class=""fr-webreport-popup-content-title"">
25-
{localizationDocx.Title}
26-
</div>
22+
<div class=""modalcontainer modalcontainer--3"" data-target=""docx"">
23+
<div class=""fr-webreport-popup-content-export-parameters"">
24+
<div class=""fr-webreport-popup-content-title"">
25+
{localizationDocx.Title}
26+
</div>
2727
28-
{(Report.PreparedPages.Count != 1 ? $@"<label class=""fr-webreport-popup-content-export-parameters-page-range-title"">{localizationPageSelector.PageRange}</label>
29-
<div class=""fr-webreport-popup-content-export-parameters-row"">
30-
<button type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"" name=""OnAllClick"" onclick=""OnAllClick()"">
31-
{localizationPageSelector.All}
32-
</button>
33-
</div>
34-
<div class=""fr-webreport-popup-content-export-parameters-row"">
35-
<button type=""button"" class=""fr-webreport-popup-content-export-parameters-button"" name=""OnFirstClick"" onclick=""OnFirstClick()"">
36-
{localizationPageSelector.First}
37-
</button>
38-
<input name =""PageSelectorInput"" style=""margin-top: 2px;"" onchange=""OnInputClickDOCX()""type=""text"" class=""fr-webreport-popup-content-export-parameters-input""pattern=""[0-9,-\s]""placeholder=""2 or 10-20""value="""" >
39-
</div>" : "")}
40-
</div>
28+
{(Report.PreparedPages.Count != 1 ? $@"<label class=""fr-webreport-popup-content-export-parameters-page-range-title"">{localizationPageSelector.PageRange}</label>
29+
<div class=""fr-webreport-popup-content-export-parameters-row"">
30+
<button type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"" name=""OnAllClick"" onclick=""OnAllClick()"">
31+
{localizationPageSelector.All}
32+
</button>
33+
</div>
34+
<div class=""fr-webreport-popup-content-export-parameters-row"">
35+
<button type=""button"" class=""fr-webreport-popup-content-export-parameters-button"" name=""OnFirstClick"" onclick=""OnFirstClick()"">
36+
{localizationPageSelector.First}
37+
</button>
38+
<input name =""PageSelectorInput"" style=""margin-top: 2px;"" onchange=""OnInputClickDOCX()""type=""text"" class=""fr-webreport-popup-content-export-parameters-input""pattern=""[0-9,-\s]""placeholder=""2 or 10-20""value="""" >
39+
</div>" : "")}
40+
</div>
4141
42-
<div class=""fr-webreport-popup-content-export-parameters"">
43-
<label>{localizationDocx.Options}</label>
44-
<div class=""fr-webreport-popup-content-export-parameters-row"">
45-
<div class=""fr-webreport-popup-content-export-parameters-col"">
46-
<button id=""DocxWysiwyg"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"">
47-
Wysiwyg
48-
</button>
49-
</div>
50-
<div class=""fr-webreport-popup-content-export-parameters-col"">
51-
<button id=""DocxPrintOptimized"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"">
52-
{localizationDocx.PrintOptimized}
53-
</button>
54-
</div>
55-
</div>
56-
<div class=""fr-webreport-popup-content-export-parameters-col"">
57-
<button id=""DocxDoNotExpandShiftReturn"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button"">
58-
{localizationDocx.DoNotExpandShiftReturn}
59-
</button>
60-
</div>
61-
<div class=""fr-webreport-popup-content-export-parameters-row"">
62-
<div class=""fr-webreport-popup-content-export-parameters-col"">
63-
<span style=""margin-left: 0.5rem;font-size: 12px; font-weight: normal; margin-top: 11px;"">{localizationDocx.RowHeightIs}</span>
64-
<span style=""margin-left: 0.5rem;font-size: 12px; font-weight: normal; margin-top: 18px;"">{localizationDocx.Options}</span>
65-
</div>
66-
<div class=""fr-webreport-popup-content-export-parameters-col"">
67-
<select class=""custom-select"" onchange=""DocxRowHeightsFunc(this)"">
68-
<option value=""Exactly"" selected>{localizationDocx.Exactly}</option>
69-
<option value=""Minimum"">{localizationDocx.Minimum}</option>
70-
</select>
71-
<select class=""custom-select"" onchange=""DocxOnRenderModeFunc(this)"">
72-
<option value=""table"">{localizationDocx.Table}</option>
73-
<option value=""layers"" selected>{localizationDocx.Layers}</option>
74-
<option value=""paragraphs"">{localizationDocx.Paragraphs}</option>
75-
</select>
76-
</div>
77-
</div>
78-
</div>
79-
<div class=""fr-webreport-popup-content-buttons"">
80-
<button class=""fr-webreport-popup-content-btn-submit fr-webreport-popup-content-btn-cancel"">{localizationPageSelector.LocalizedCancel}</button>
81-
<button class=""fr-webreport-popup-content-btn-submit"" onclick=""DOCXExport()"">OK</button>
82-
</div>
83-
</div>
42+
<div class=""fr-webreport-popup-content-export-parameters"">
43+
<label>{localizationDocx.Options}</label>
44+
<div class=""fr-webreport-popup-content-export-parameters-row"">
45+
<div class=""fr-webreport-popup-content-export-parameters-col"">
46+
<button id=""DocxWysiwyg"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"">
47+
Wysiwyg
48+
</button>
49+
</div>
50+
<div class=""fr-webreport-popup-content-export-parameters-col"">
51+
<button id=""DocxPrintOptimized"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"">
52+
{localizationDocx.PrintOptimized}
53+
</button>
54+
</div>
55+
</div>
56+
<div class=""fr-webreport-popup-content-export-parameters-col"">
57+
<button id=""DocxDoNotExpandShiftReturn"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button"">
58+
{localizationDocx.DoNotExpandShiftReturn}
59+
</button>
60+
</div>
61+
<div class=""fr-webreport-popup-content-export-parameters-row"">
62+
<div class=""fr-webreport-popup-content-export-parameters-col"">
63+
<span style=""margin-left: 0.5rem;font-size: 12px; font-weight: normal; margin-top: 11px;"">{localizationDocx.RowHeightIs}</span>
64+
<span style=""margin-left: 0.5rem;font-size: 12px; font-weight: normal; margin-top: 18px;"">{localizationDocx.Options}</span>
65+
</div>
66+
<div class=""fr-webreport-popup-content-export-parameters-col"">
67+
<select class=""custom-select"" onchange=""DocxRowHeightsFunc(this)"">
68+
<option value=""Exactly"" selected>{localizationDocx.Exactly}</option>
69+
<option value=""Minimum"">{localizationDocx.Minimum}</option>
70+
</select>
71+
<select class=""custom-select"" onchange=""DocxOnRenderModeFunc(this)"">
72+
<option value=""table"">{localizationDocx.Table}</option>
73+
<option value=""layers"" selected>{localizationDocx.Layers}</option>
74+
<option value=""paragraphs"">{localizationDocx.Paragraphs}</option>
75+
</select>
76+
</div>
77+
</div>
78+
</div>
79+
<div class=""fr-webreport-popup-content-buttons"">
80+
<button class=""fr-webreport-popup-content-btn-submit fr-webreport-popup-content-btn-cancel"">{localizationPageSelector.LocalizedCancel}</button>
81+
<button class=""fr-webreport-popup-content-btn-submit"" onclick=""DOCXExport()"">OK</button>
82+
</div>
83+
</div>
8484
8585
<script>
86-
{template_modalcontainerscript}
87-
//DOCXEXPORT//
88-
var DocxButtons;
89-
var DocxRowHeights = '&RowHeightIs=Exactly&MatrixBased=false';
90-
var DocxOnRenderMode = '&PrintFit=layers';
91-
var DocxWysiwyg = false;
92-
var DocxPrintOptimized = false;
93-
var DocxDoNotExpandShiftReturn = false;
86+
{template_modalcontainerscript}
87+
//DOCXEXPORT//
88+
var DocxButtons;
89+
var DocxRowHeights = '&RowHeightIs=Exactly&MatrixBased=false';
90+
var DocxOnRenderMode = '&PrintFit=layers';
91+
var DocxWysiwyg = false;
92+
var DocxPrintOptimized = false;
93+
var DocxDoNotExpandShiftReturn = false;
9494
95-
function OnInputClickDOCX() {{
96-
{template_pscustom}
97-
95+
function OnInputClickDOCX() {{
96+
{template_pscustom}
97+
}}
98+
function DocxRowHeightsFunc(select) {{
99+
const DocxRowHeightsChange = select.querySelector(`option[value='${{select.value}}']`)
100+
DocxRowHeights = '&RowHeightIs=' + DocxRowHeightsChange.value + '&MatrixBased=false';
101+
}}
102+
function DocxOnRenderModeFunc(select) {{
103+
const DocxOnRenderModeChange = select.querySelector(`option[value='${{select.value}}']`)
104+
DocxOnRenderMode = '&PrintFit=' + DocxOnRenderModeChange.value;
105+
}}
106+
function DOCXExport() {{
107+
if (document.getElementById('DocxPrintOptimized').classList.contains('activeButton')) {{
108+
DocxPrintOptimized = new Boolean(true);
98109
}}
99-
function DocxRowHeightsFunc(select) {{
100-
const DocxRowHeightsChange = select.querySelector(`option[value='${{select.value}}']`)
101-
DocxRowHeights = '&RowHeightIs=' + DocxRowHeightsChange.value + '&MatrixBased=false';
110+
else {{ DocxPrintOptimized = false; }};
111+
if (document.getElementById('DocxDoNotExpandShiftReturn').classList.contains('activeButton')) {{
112+
DocxDoNotExpandShiftReturn = new Boolean(true);
102113
}}
103-
function DocxOnRenderModeFunc(select) {{
104-
const DocxOnRenderModeChange = select.querySelector(`option[value='${{select.value}}']`)
105-
DocxOnRenderMode = '&PrintFit=' + DocxOnRenderModeChange.value;
114+
else {{ DocxDoNotExpandShiftReturn = false; }};
115+
if (document.getElementById('DocxWysiwyg').classList.contains('activeButton')) {{
116+
DocxWysiwyg = new Boolean(true);
106117
}}
107-
function DOCXExport() {{
108-
if (document.getElementById('DocxPrintOptimized').classList.contains('activeButton')) {{
109-
DocxPrintOptimized = new Boolean(true);
110-
}}
111-
else {{ DocxPrintOptimized = false; }};
112-
if (document.getElementById('DocxDoNotExpandShiftReturn').classList.contains('activeButton')) {{
113-
DocxDoNotExpandShiftReturn = new Boolean(true);
114-
}}
115-
else {{ DocxDoNotExpandShiftReturn = false; }};
116-
if (document.getElementById('DocxWysiwyg').classList.contains('activeButton')) {{
117-
DocxWysiwyg = new Boolean(true);
118-
}}
119-
else {{ DocxWysiwyg = false; }};
120-
DocxButtons = ('&PrintOptimized=' + DocxPrintOptimized + '&DoNotExpandShiftReturn=' + DocxDoNotExpandShiftReturn + '&Wysiwyg=' + DocxWysiwyg);
118+
else {{ DocxWysiwyg = false; }};
119+
DocxButtons = ('&PrintOptimized=' + DocxPrintOptimized + '&DoNotExpandShiftReturn=' + DocxDoNotExpandShiftReturn + '&Wysiwyg=' + DocxWysiwyg);
121120
122-
window.location.href = DocxExport.href + DocxButtons + PageSelector;
123-
}}
124-
</script>
125-
126-
";
121+
window.location.href = DocxExport.href + DocxButtons + PageSelector;
122+
}}
123+
</script>";
127124

128125
}
129126

0 commit comments

Comments
 (0)