Skip to content

Commit

Permalink
Merge pull request #509 from FastReports/sync_branch_2022.3.15
Browse files Browse the repository at this point in the history
FastReport.OpenSource 2022.3.15
  • Loading branch information
0legK authored Nov 17, 2022
2 parents e1d95a1 + c4bd1b3 commit 3d38195
Show file tree
Hide file tree
Showing 15 changed files with 1,091 additions and 1,114 deletions.
7 changes: 3 additions & 4 deletions FastReport.Base/Export/Html/HTMLExportLayers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ private void LayerText(FastString Page, TextObject obj)
{
top = obj.Height - htmlTextRenderer.CalcHeight();
}
FastString sb = GetHtmlParagraph(htmlTextRenderer);
FastString sb = GetHtmlParagraph(htmlTextRenderer, obj.Left);

LayerBack(Page, obj,
GetSpanText(obj, sb,
Expand Down Expand Up @@ -391,7 +391,7 @@ private void LayerText(FastString Page, TextObject obj)

}

private FastString GetHtmlParagraph(HtmlTextRenderer renderer)
private FastString GetHtmlParagraph(HtmlTextRenderer renderer, float Left)
{
FastString sb = new FastString();

Expand Down Expand Up @@ -492,9 +492,8 @@ private FastString GetHtmlParagraph(HtmlTextRenderer renderer)

}
}

}
prevWidth += run.Width;
prevWidth = run.Left + run.Width - Left;
//run.ToHtml(sb, true);
}
}
Expand Down
189 changes: 93 additions & 96 deletions FastReport.Core.Web/Templates/ExportSettings/DocxExportSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,111 +19,108 @@ internal string template_DocxExportSettings()
var localizationPageSelector = new PageSelectorLocalization(Res);

return $@"
<div class=""modalcontainer modalcontainer--3"" data-target=""docx"">
<div class=""fr-webreport-popup-content-export-parameters"">
<div class=""fr-webreport-popup-content-title"">
{localizationDocx.Title}
</div>
<div class=""modalcontainer modalcontainer--3"" data-target=""docx"">
<div class=""fr-webreport-popup-content-export-parameters"">
<div class=""fr-webreport-popup-content-title"">
{localizationDocx.Title}
</div>
{(Report.PreparedPages.Count != 1 ? $@"<label class=""fr-webreport-popup-content-export-parameters-page-range-title"">{localizationPageSelector.PageRange}</label>
<div class=""fr-webreport-popup-content-export-parameters-row"">
<button type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"" name=""OnAllClick"" onclick=""OnAllClick()"">
{localizationPageSelector.All}
</button>
</div>
<div class=""fr-webreport-popup-content-export-parameters-row"">
<button type=""button"" class=""fr-webreport-popup-content-export-parameters-button"" name=""OnFirstClick"" onclick=""OnFirstClick()"">
{localizationPageSelector.First}
</button>
<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="""" >
</div>" : "")}
</div>
{(Report.PreparedPages.Count != 1 ? $@"<label class=""fr-webreport-popup-content-export-parameters-page-range-title"">{localizationPageSelector.PageRange}</label>
<div class=""fr-webreport-popup-content-export-parameters-row"">
<button type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"" name=""OnAllClick"" onclick=""OnAllClick()"">
{localizationPageSelector.All}
</button>
</div>
<div class=""fr-webreport-popup-content-export-parameters-row"">
<button type=""button"" class=""fr-webreport-popup-content-export-parameters-button"" name=""OnFirstClick"" onclick=""OnFirstClick()"">
{localizationPageSelector.First}
</button>
<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="""" >
</div>" : "")}
</div>
<div class=""fr-webreport-popup-content-export-parameters"">
<label>{localizationDocx.Options}</label>
<div class=""fr-webreport-popup-content-export-parameters-row"">
<div class=""fr-webreport-popup-content-export-parameters-col"">
<button id=""DocxWysiwyg"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"">
Wysiwyg
</button>
</div>
<div class=""fr-webreport-popup-content-export-parameters-col"">
<button id=""DocxPrintOptimized"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"">
{localizationDocx.PrintOptimized}
</button>
</div>
</div>
<div class=""fr-webreport-popup-content-export-parameters-col"">
<button id=""DocxDoNotExpandShiftReturn"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button"">
{localizationDocx.DoNotExpandShiftReturn}
</button>
</div>
<div class=""fr-webreport-popup-content-export-parameters-row"">
<div class=""fr-webreport-popup-content-export-parameters-col"">
<span style=""margin-left: 0.5rem;font-size: 12px; font-weight: normal; margin-top: 11px;"">{localizationDocx.RowHeightIs}</span>
<span style=""margin-left: 0.5rem;font-size: 12px; font-weight: normal; margin-top: 18px;"">{localizationDocx.Options}</span>
</div>
<div class=""fr-webreport-popup-content-export-parameters-col"">
<select class=""custom-select"" onchange=""DocxRowHeightsFunc(this)"">
<option value=""Exactly"" selected>{localizationDocx.Exactly}</option>
<option value=""Minimum"">{localizationDocx.Minimum}</option>
</select>
<select class=""custom-select"" onchange=""DocxOnRenderModeFunc(this)"">
<option value=""table"">{localizationDocx.Table}</option>
<option value=""layers"" selected>{localizationDocx.Layers}</option>
<option value=""paragraphs"">{localizationDocx.Paragraphs}</option>
</select>
</div>
</div>
</div>
<div class=""fr-webreport-popup-content-buttons"">
<button class=""fr-webreport-popup-content-btn-submit fr-webreport-popup-content-btn-cancel"">{localizationPageSelector.LocalizedCancel}</button>
<button class=""fr-webreport-popup-content-btn-submit"" onclick=""DOCXExport()"">OK</button>
</div>
</div>
<div class=""fr-webreport-popup-content-export-parameters"">
<label>{localizationDocx.Options}</label>
<div class=""fr-webreport-popup-content-export-parameters-row"">
<div class=""fr-webreport-popup-content-export-parameters-col"">
<button id=""DocxWysiwyg"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"">
Wysiwyg
</button>
</div>
<div class=""fr-webreport-popup-content-export-parameters-col"">
<button id=""DocxPrintOptimized"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button activeButton"">
{localizationDocx.PrintOptimized}
</button>
</div>
</div>
<div class=""fr-webreport-popup-content-export-parameters-col"">
<button id=""DocxDoNotExpandShiftReturn"" type=""button"" class=""fr-webreport-popup-content-export-parameters-button"">
{localizationDocx.DoNotExpandShiftReturn}
</button>
</div>
<div class=""fr-webreport-popup-content-export-parameters-row"">
<div class=""fr-webreport-popup-content-export-parameters-col"">
<span style=""margin-left: 0.5rem;font-size: 12px; font-weight: normal; margin-top: 11px;"">{localizationDocx.RowHeightIs}</span>
<span style=""margin-left: 0.5rem;font-size: 12px; font-weight: normal; margin-top: 18px;"">{localizationDocx.Options}</span>
</div>
<div class=""fr-webreport-popup-content-export-parameters-col"">
<select class=""custom-select"" onchange=""DocxRowHeightsFunc(this)"">
<option value=""Exactly"" selected>{localizationDocx.Exactly}</option>
<option value=""Minimum"">{localizationDocx.Minimum}</option>
</select>
<select class=""custom-select"" onchange=""DocxOnRenderModeFunc(this)"">
<option value=""table"">{localizationDocx.Table}</option>
<option value=""layers"" selected>{localizationDocx.Layers}</option>
<option value=""paragraphs"">{localizationDocx.Paragraphs}</option>
</select>
</div>
</div>
</div>
<div class=""fr-webreport-popup-content-buttons"">
<button class=""fr-webreport-popup-content-btn-submit fr-webreport-popup-content-btn-cancel"">{localizationPageSelector.LocalizedCancel}</button>
<button class=""fr-webreport-popup-content-btn-submit"" onclick=""DOCXExport()"">OK</button>
</div>
</div>
<script>
{template_modalcontainerscript}
//DOCXEXPORT//
var DocxButtons;
var DocxRowHeights = '&RowHeightIs=Exactly&MatrixBased=false';
var DocxOnRenderMode = '&PrintFit=layers';
var DocxWysiwyg = false;
var DocxPrintOptimized = false;
var DocxDoNotExpandShiftReturn = false;
{template_modalcontainerscript}
//DOCXEXPORT//
var DocxButtons;
var DocxRowHeights = '&RowHeightIs=Exactly&MatrixBased=false';
var DocxOnRenderMode = '&PrintFit=layers';
var DocxWysiwyg = false;
var DocxPrintOptimized = false;
var DocxDoNotExpandShiftReturn = false;
function OnInputClickDOCX() {{
{template_pscustom}
function OnInputClickDOCX() {{
{template_pscustom}
}}
function DocxRowHeightsFunc(select) {{
const DocxRowHeightsChange = select.querySelector(`option[value='${{select.value}}']`)
DocxRowHeights = '&RowHeightIs=' + DocxRowHeightsChange.value + '&MatrixBased=false';
}}
function DocxOnRenderModeFunc(select) {{
const DocxOnRenderModeChange = select.querySelector(`option[value='${{select.value}}']`)
DocxOnRenderMode = '&PrintFit=' + DocxOnRenderModeChange.value;
}}
function DOCXExport() {{
if (document.getElementById('DocxPrintOptimized').classList.contains('activeButton')) {{
DocxPrintOptimized = new Boolean(true);
}}
function DocxRowHeightsFunc(select) {{
const DocxRowHeightsChange = select.querySelector(`option[value='${{select.value}}']`)
DocxRowHeights = '&RowHeightIs=' + DocxRowHeightsChange.value + '&MatrixBased=false';
else {{ DocxPrintOptimized = false; }};
if (document.getElementById('DocxDoNotExpandShiftReturn').classList.contains('activeButton')) {{
DocxDoNotExpandShiftReturn = new Boolean(true);
}}
function DocxOnRenderModeFunc(select) {{
const DocxOnRenderModeChange = select.querySelector(`option[value='${{select.value}}']`)
DocxOnRenderMode = '&PrintFit=' + DocxOnRenderModeChange.value;
else {{ DocxDoNotExpandShiftReturn = false; }};
if (document.getElementById('DocxWysiwyg').classList.contains('activeButton')) {{
DocxWysiwyg = new Boolean(true);
}}
function DOCXExport() {{
if (document.getElementById('DocxPrintOptimized').classList.contains('activeButton')) {{
DocxPrintOptimized = new Boolean(true);
}}
else {{ DocxPrintOptimized = false; }};
if (document.getElementById('DocxDoNotExpandShiftReturn').classList.contains('activeButton')) {{
DocxDoNotExpandShiftReturn = new Boolean(true);
}}
else {{ DocxDoNotExpandShiftReturn = false; }};
if (document.getElementById('DocxWysiwyg').classList.contains('activeButton')) {{
DocxWysiwyg = new Boolean(true);
}}
else {{ DocxWysiwyg = false; }};
DocxButtons = ('&PrintOptimized=' + DocxPrintOptimized + '&DoNotExpandShiftReturn=' + DocxDoNotExpandShiftReturn + '&Wysiwyg=' + DocxWysiwyg);
else {{ DocxWysiwyg = false; }};
DocxButtons = ('&PrintOptimized=' + DocxPrintOptimized + '&DoNotExpandShiftReturn=' + DocxDoNotExpandShiftReturn + '&Wysiwyg=' + DocxWysiwyg);
window.location.href = DocxExport.href + DocxButtons + PageSelector;
}}
</script>
";
window.location.href = DocxExport.href + DocxButtons + PageSelector;
}}
</script>";

}

Expand Down
Loading

0 comments on commit 3d38195

Please sign in to comment.