我正在用c#在fastreport.Then中创建.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();
}发布于 2019-04-22 23:09:01
report1.ReportInfo.xxx属性控制FastReports对象中的信息数据(并保存在*.FR3文件中)。它们不会写入PDF导出中的数据。为此,您需要访问正在使用的TfrxExportPDF对象。该对象具有Title, Author, Subject, Keywords, Creator, Producer属性
https://stackoverflow.com/questions/55791004
复制相似问题