zoukankan      html  css  js  c++  java
  • 如何利用FastReport.Net 设计并导出报表?

    在你的程序中,你可以使用FastReport.Net 报表设计器。要做到这一点,你需要使用报表对象设计方法:

    report1 = new Report();
    report1.Load("report1.frx");
    report1.Design();

    设计方法被重载:

    方法描述
    bool Design() 显示设计器
    bool Design(
    bool modal)
    显示设计器,modal参数决定是否需要形式上展示设计器
    bool Design(
    Form mdiParent)
    显示设计器,mdiParent参数定义主要的MDI窗口

    导出报表

    设计好的报表可以被导出为FastReport报表所支持的其中一种格式。你可以导出为下列格式中的一种:

    • PDF
    • HTML
    • RTF
    • Excel XML (Excel 2003+)
    • Excel 2007
    • CSV
    • TXT
    • OpenOffice Calc
    • Pictures (Bmp, Png, Jpeg, Gif, Tiff, Metafile)

    通过导出过滤器来导出,步骤如下:

    • 通过Prepare方法准备一个报表
    • 创建一个导出过滤器实例,并设置其属性
    • 调用报表对象的导出方法

    下面的例子导出了一个HTML格式编写的报表:

    // prepare a report
    report1.Prepare();
    // create an instance of HTML export filter
    FastReport.Export.Html.HTMLExport export = new FastReport.Export.Html.HTMLExport();
    // show the export options dialog and do the export
    if (export.ShowDialog())
    report1.Export(export, "result.html");

  • 相关阅读:
    ZOJ Problem Set
    ZOJ Problem Set
    ZOJ Problem Set
    ZOJ Problem Set
    ZOJ Problem Set
    387.First Unique Character in a String
    169. Majority Element
    postgresql 导出函数的方法
    455. Assign Cookies.md
    python模拟shell执行脚本
  • 原文地址:https://www.cnblogs.com/zhaogaojian/p/8349686.html
Copyright © 2011-2022 走看看