FastReport中国社区FastReport联系电话 联系电话:023-68661681

可视化报告生成器FastReport VCL功能指南:从Delphi / C ++ Builder / Lazarus保存SVG图像

来源:   发布时间:2020-08-20   浏览:次

报表生成器FastReport VCL是用于在软件中集成商务智能的现代解决方案。它提供了可视化模板设计器,可以访问最受欢迎的数据源,报告引擎,预览,将过滤器导出为30多种格式,并可以部署到云,Web,电子邮件和打印中。

近日,FastReport VCL更新至v6.7,在新版本中,添加了对最新版本IDE的支持,简化了用于付款标准的条形码的创建,新增从预览窗口直接编辑RichView的功能,同时修复了多个Bug问题。欢迎下载体验。(点击下方按钮下载)

点击下载最新版FastReport VCL

SVG文件是基于XML格式的文档的二维矢量图像。SVG格式不仅用于描述二维矢量图形,而且还用于混合矢量光栅图像。span>

让我们看看SVG格式有哪些优点:

SVG

  1. 正如前面在上一篇文章中提到的,矢量图形缩放后不会失去质量(放大后,图像不会变成立体主义艺术)。
  2. SVG与web技术完全兼容,因此将成为任何web站点的有机组成部分。
  3. 将Javascript添加到对象中,我们可以使图像具有交互性,也就是说,用给定的答案来响应特定的用户操作——与图像及其形式相关。
  4. SVG文件被认为是文本,所以可以通过直接向图像代码添加关键字来优化文件,而不需要外部meta标记。

让我们看看SVG格式有哪些缺陷:

  1. 文件大小将迅速增加,就像雪崩时增加图像的细节。但是,对于包含大量细节的图像,最好使用PNG或JPG格式。因此,遗憾的是,SVG完全不适合用于真实的高分辨率照片和该地区的详细地图。
  2. 较老的浏览器(Internet Explorer 8或更老的浏览器)不支持SVG。
  3. 由于安全问题,默认情况下(例如WordPress)不允许你上传SVG文件。WordPress认为这个扩展是恶意的,因此阻止了它。
  4. SVG适合于创建简单的对象,这些对象可以通过简单的图形或其部件进行描述。
  5. 社交网络,比如Facebook和Twitter,不支持SVG格式。如果使用SVG文件作为缩略图,将不得不使用插件和设置PNG或JPG的元标签。
如何使用Delphi或Lazarus保存SVG文件?

创建报告。在我们创建了所需的东西之后,启动它并查看。调用预览并选择我们需要的格式。

可视化报告生成器FastReport VCL功能指南:从Delphi / C ++ Builder / Lazarus保存SVG图像

现在,我们看到一个具有许多不同设置的窗口。设置我们需要的一切,然后单击“确定”!

可视化报告生成器FastReport VCL功能指南:从Delphi / C ++ Builder / Lazarus保存SVG图像
使用Delphi / C ++ Builder / Lazarus代码保存SVG文件
procedure TForm1.Button1Click(Sender: TObject);
begin
 {Generate a report. The report must be generated before exporting}
 frxReport1.PrepareReport();
 {Set the range of pages to export. By default, all pages of the generated report are exported}
 frxSVGExport1.PageNumbers := '2-3';
 {Set whether to export styles of the objects}
 frxSVGExport1.EmbeddedCSS := True;
 {Set whether to convert all images in accordance with PictureFormat:}
 {if the image in the report is in BMP format and the PictureFormat is PNG, then BMP will be saved in PNG format}
 frxSVGExport1.UnifiedPictures := True;
 {Set whether to format the source text of SVG (increases the size of the resulting file)}
 frxSVGExport1.Formatted := False;
 {Set whether to export pictures}
 frxSVGExport1.EmbeddedPictures := True;
 {Set whether to export each page to a separate SVG file}
 frxSVGExport1.Multipage := False;
 {Set whether to add navigation buttons to the resulting SVG file}
 frxSVGExport1.Navigation := False;
 {Set in which format to export pictures}
 //uses frxExportHelpers;
 // TfrxPictureFormat = (pfPNG, {$IFNDEF FPC}pfEMF,{$ENDIF} pfBMP, pfJPG);)
 frxSVGExport1.PictureFormat := pfPNG;
 {Set whether to open the resulting file after export}
 frxSVGExport1.OpenAfterExport := False;
 {Set whether to display export progress (show which page is currently being exported)}
 frxSVGExport1.ShowProgress := False;
 {Set whether to display the export filter dialog box}
 frxSVGExport1.ShowDialog := False;
 {Set the name of the resulting file.}
 {Please note that if you do not set the file name and disable the export filter dialog box,}
 {the file name selection dialog will still be displayed}
 frxSVGExport1.FileName := 'C:\Output\test.svg';
 {Export the report}
 frxReport1.Export(frxSVGExport1);
end;

让我们比较一下导出栅格和矢量对象的结果!将在下面提供JPEG和SVG示例。

JPEG格式

可视化报告生成器FastReport VCL功能指南:从Delphi / C ++ Builder / Lazarus保存SVG图像

SVG格式

可视化报告生成器FastReport VCL功能指南:从Delphi / C ++ Builder / Lazarus保存SVG图像

Fastreport在线下单立享85折起!赶紧加入购物清单吧!

还想要更多吗?您可以点击阅读【FastReport 报表2020最新资源盘点】,查找需要的教程资源。如果您有任何疑问或需求,请随时加入FastReport技术交流群(783996712),我们很高兴为您提供查询和咨询。

本站文章除注明转载外,均为本站原创或翻译
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:FastReport控件中文网 [https://www.fastreportcn.com/]
本文地址:https://www.fastreportcn.com/post/2873.html

联系我们
  • 重庆总部 023-68661681
购买
  • sales@evget.com
合作
  • business@evget.com


在线
客服
微信
QQ 电话
023-68661681
返回
顶部