FastReport文档属性(标题,主题,版本,作者)设置

时间:2019-04-22 07:51:14

标签: fastreport

我要在fastreport中使用c#创建.pdf报告,然后尝试在报告中设置文档属性。在FastReport中,这些属性既具有set属性又具有get属性,但是这些功能未分配给我保存的报告。

在将报告另存为.pdf之前,FastReport可以打开自己的表单并在此处输入相关的主题,标题和作者数据,但是我不希望用户每次都输入此过程。我想用C#编程设置这些属性。

我该怎么做?

   //c# codes
   public Report_Test() 
   {
   FastReport.Report report1 = new FastReport.Report();
   report1.ReportInfo.Author = "Test Test";
   report1.ReportInfo.Description = "TEST Report";
   report1.ReportInfo.Created = DateTime.Now;
   report1.ReportInfo.CreatorVersion = "1.1";
   report1.ReportInfo.Modified = DateTime.Now;
   report1.ReportInfo.Name = "1.1";
   report1.ReportInfo.Version = "1.1";
   /*
   I wrote other codes here ()
   */
   report1.RegisterData(dataSet11.Tables["Datas"], "Datas");
   report1.GetDataSource("Datas").Enabled = true;
   (report1.Report.FindObject("Data1") as FastReport.DataBand).DataSource = 
    report1.GetDataSource("Datas");
    report1.Show();
   }

1 个答案:

答案 0 :(得分:0)

report1.ReportInfo.xxx属性控制FastReports对象中的信息数据(并保存在* .FR3文件中)。它们不会写入PDF导出中的数据中。为此,您需要访问正在使用的TfrxExportPDF对象。该对象具有属性Title, Author, Subject, Keywords, Creator, Producer

相关问题