首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FastReport文档属性(标题、主题、版本、作者)设置

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

Stack Overflow用户
提问于 2019-04-22 15:51:14
回答 1查看 153关注 0票数 0

我正在用c#在fastreport.Then中创建.pdf报告,我试图在报告中设置文档属性。在FastReport中,这些属性既有set属性,也有get属性,但这些特性没有分配给我保存的报告。

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

我该怎么做呢?

代码语言:javascript
复制
   //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();
   }
EN

回答 1

Stack Overflow用户

发布于 2019-04-22 23:09:01

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55791004

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档