Skip to content

Commit

Permalink
Merge pull request #362 from FastReports/sync_branch_2022.1.0
Browse files Browse the repository at this point in the history
FastReport.OpenSource 2022.1.0
  • Loading branch information
0legK authored Dec 6, 2021
2 parents 09a5267 + 5dbf69b commit dd337ea
Show file tree
Hide file tree
Showing 50 changed files with 3,639 additions and 237 deletions.
40 changes: 24 additions & 16 deletions Demos/Reports/Barcode.frx

Large diffs are not rendered by default.

835 changes: 835 additions & 0 deletions FastReport.Base/Barcode/BarcodeGS1.cs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions FastReport.Base/Barcode/BarcodeObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,10 @@ public BarcodeItem(Type objType, string barcodeName)
new BarcodeItem(typeof(BarcodeAztec), "Aztec"),
new BarcodeItem(typeof(BarcodePlessey), "Plessey"),
new BarcodeItem(typeof(BarcodeEAN128), "GS1-128 (UCC/EAN-128)"),
new BarcodeItem(typeof(BarcodeGS1Omnidirectional), "GS1 DataBar Omnidirectional"),
new BarcodeItem(typeof(BarcodeGS1Limited), "GS1 DataBar Limited"),
new BarcodeItem(typeof(BarcodeGS1Stacked), "GS1 DataBar Stacked"),
new BarcodeItem(typeof(BarcodeGS1StackedOmnidirectional), "GS1 DataBar Stacked Omnidirectional"),
new BarcodeItem(typeof(BarcodePharmacode), "Pharmacode"),
new BarcodeItem(typeof(BarcodeIntelligentMail), "Intelligent Mail (USPS)"),
new BarcodeItem(typeof(BarcodeMaxiCode), "MaxiCode")
Expand Down
6 changes: 3 additions & 3 deletions FastReport.Base/Barcode/LinearBarcodeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private void MakeModules()
modules[3] = modules[1] * 2;
}

private void DoLines(string data, IGraphics g, float zoom)
internal virtual void DoLines(string data, IGraphics g, float zoom)
{
using (Pen pen = new Pen(Color))
{
Expand Down Expand Up @@ -196,7 +196,7 @@ private void DoLines(string data, IGraphics g, float zoom)
}
}

private string CheckSumModulo10(string data)
public string CheckSumModulo10(string data)
{
int sum = 0;
int fak = data.Length;
Expand Down Expand Up @@ -358,7 +358,7 @@ internal string MakeLong(string data)
return builder.ToString();
}

internal float GetWidth(string code)
internal virtual float GetWidth(string code)
{
float result = 0;
float w;
Expand Down
24 changes: 24 additions & 0 deletions FastReport.Base/Export/Html/HTMLExport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public enum ExportType

private bool layers;
private bool wysiwyg;
private bool notRotateLandscapePage;
private MyRes res;
private HtmlTemplates templates;
private string targetPath;
Expand Down Expand Up @@ -417,6 +418,15 @@ public bool EnableVectorObjects
set { enableVectorObjects = value; }
}

/// <summary>
/// Not rotate landscape page when print.
/// </summary>
public bool NotRotateLandscapePage
{
get { return notRotateLandscapePage; }
set { notRotateLandscapePage = value; }
}

#endregion Public properties

#region Private methods
Expand Down Expand Up @@ -687,6 +697,18 @@ protected override void Start()
singlePage = true;
subFolder = false;
navigator = false;
if(ExportMode == ExportType.WebPrint)
{
NotRotateLandscapePage = true;
for (int i = 0; i < Report.PreparedPages.Count; i++ )
{
if (!Report.PreparedPages.GetPage(i).Landscape)
{
NotRotateLandscapePage = false;
break;
}
}
}
if (format == HTMLExportFormat.HTML && !embedPictures)
pictures = false;
}
Expand Down Expand Up @@ -945,6 +967,7 @@ public override void Serialize(FRWriter writer)
writer.WriteBool("SubFolder", SubFolder);
writer.WriteBool("Navigator", Navigator);
writer.WriteBool("SinglePage", SinglePage);
writer.WriteBool("NotRotateLandscapePage", NotRotateLandscapePage);
}

/// <summary>
Expand Down Expand Up @@ -996,6 +1019,7 @@ public HTMLExport()
exportMode = ExportType.Export;
res = new MyRes("Export,Html");
embeddedImages = new Dictionary<string, string>();
notRotateLandscapePage = false;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Export/Html/HTMLExportDraw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private string HTMLGetStylesHeader()
header.AppendLine("<style type=\"text/css\" media=\"print\"><!--");
header.Append("div." + pageStyleName +
" { page-break-after: always; page-break-inside: avoid; ");
if (d.page.Landscape)
if (d.page.Landscape && !NotRotateLandscapePage)
{
header.Append("width:").Append(Px(maxHeight * Zoom).Replace(";", " !important;"))
.Append("transform: rotate(90deg); -webkit-transform: rotate(90deg)");
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Report.cs
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ public IGraphics MeasureGraphics
}
}

internal string GetReportName
public string GetReportName
{
get
{
Expand Down
2 changes: 2 additions & 0 deletions FastReport.Base/Utils/HtmlTextRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,8 @@ public RunText(HtmlTextRenderer renderer, Word word, StyleDescriptor style, List
float ascent = ff.FontFamily.GetCellAscent(style.FontStyle);
baseLine = height * ascent / lineSpace;
descent = height - baseLine;
if (style.BaseLine == HtmlTextRenderer.BaseLine.Subscript)
descent += height * 0.45f;
}
}

Expand Down
89 changes: 68 additions & 21 deletions FastReport.Core.Web/Application/ExportMenuSettings.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
using System;
using System.Drawing;

namespace FastReport.Web
{
public class ExportMenuSettings
{
private const Exports defaultExports =
Exports.Prepared | Exports.Pdf | Exports.Excel2007 | Exports.Word2007 | Exports.Text | Exports.Rtf
| Exports.Xps | Exports.Ods | Exports.Odt | Exports.XmlExcel | Exports.Csv;
{

private const Exports allExports =
Exports.Prepared | Exports.Pdf | Exports.Excel2007 | Exports.Word2007 | Exports.PowerPoint2007 | Exports.XmlExcel
| Exports.Text | Exports.Rtf | Exports.Xps | Exports.Ods | Exports.Odt | Exports.Dbf | Exports.Csv | Exports.Mht
| Exports.HTML | Exports.Hpgl /*| Exports.Email*/ | Exports.Dxf | Exports.Json | Exports.LaTeX /*| Exports.Image*/
| Exports.Ppml | Exports.PS | Exports.Xaml | Exports.Zpl | Exports.Excel97 | Exports.Svg;

/// <summary>
/// Show Exports menu
/// </summary>
Expand All @@ -22,23 +14,73 @@ public class ExportMenuSettings
/// <summary>
/// Used to set exports in toolbar.
/// </summary>
public Exports ExportTypes { get; set; } = defaultExports;
public Exports ExportTypes { get; set; } = Exports.Default;
/// <summary>
/// Used to change font family, style in export settings.
/// </summary>
public Font FontSettings { get; set; } = null;
/// <summary>
/// Used to change font color in export settings.
/// </summary>
public Color FontColor { get; set; } = Color.White;
/// <summary>
/// Used to change window, buttons color in export settings.
/// </summary>
public Color Color { get; set; } = Color.Maroon;

/// <summary>
/// Used to on/off export settings.
/// </summary>
public bool EnableSettings { get; set; } = false;

internal string UserFontSettingsStyle
{
get
{
if (FontSettings != null)
{
return FontSettings.Style + " ";
}
else
return "";
}

}

internal string UserFontSettingsFamily
{
get
{
if (FontSettings != null)
{
return " " + FontSettings.OriginalFontName;
}
else
return "Verdana,Arial";

}
}

/// <summary>
/// Get an instance of ExportMenuSettings with default exports
/// <para>Default : Prepared, Pdf, Excel2007, Word2007, Text, Rtf, Xps, Ods, Odt, XmlExcel, Csv</para>
/// </summary>
public static ExportMenuSettings Default => new ExportMenuSettings
{
ExportTypes = defaultExports
ExportTypes = Exports.Default

};

/// <summary>
/// Get an instance of ExportMenuSettings with all exports
/// </summary>
public static ExportMenuSettings All => new ExportMenuSettings
{
ExportTypes = allExports
ExportTypes = Exports.All

};


/// <summary>
/// Switch a visibility of prepared report export in toolbar
/// </summary>
Expand All @@ -49,6 +91,7 @@ public bool ShowPreparedReport
}

#if !OPENSOURCE

/// <summary>
/// Switches a visibility of PDF (Adobe Acrobat) export in toolbar.
/// </summary>
Expand Down Expand Up @@ -205,16 +248,13 @@ public bool ShowLaTeXExport
get => GetExport(Exports.LaTeX);
set => SetExport(value, Exports.LaTeX);
}
/// <summary>
/// Switches a visibility of Image export in toolbar.
/// </summary>
//public bool ShowImageExport
//{
// get => (ExportTypes & Exports.Image) > 0;
// set
// {
// if (value)
// ExportTypes |= Exports.Image;
// else
// ExportTypes &= ~Exports.Image;
// }
// get => GetExport(Exports.Image);
// set => SetExport(value, Exports.Image);
//}
/// <summary>
/// Switches visibility the PPML export in toolbar.
Expand Down Expand Up @@ -313,5 +353,12 @@ public enum Exports
Zpl = 16_777_216,
Excel97 = 33_554_432,
Svg = 67_108_864,

Default = Prepared | Pdf | Excel2007 | Word2007 | Text | Rtf
| Xps | Ods | Odt | XmlExcel | Csv,

All = Default | PowerPoint2007 | Dbf | Mht
| HTML | Hpgl /*| Email*/ | Dxf | Json | LaTeX /*| Image*/
| Ppml | PS | Xaml | Zpl | Excel97 | Svg,
}
}
Loading

0 comments on commit dd337ea

Please sign in to comment.