Active Reports - Add Current Print Date and Time to ActiveReport

<< Click to Display Table of Contents >>

Navigation:  Professional > Reports > Active Reports (Deprecated) >

Active Reports - Add Current Print Date and Time to ActiveReport

To add the date and time to the footer of an ActiveReport follow the steps below.

 

Create the Object on the Page by following the steps below.

 

1.Click on the TextBox object on the Toolbox toolbar.

2.Draw the TextBox in the PageFooter area of the report.

3.Change the (Name) property of the TextBox to "ReportDate".

4.Add the Code required to populate the ReportDate TextBox.

5.Switch from the ActiveReports Designer to the Script Editor by clicking on the Script Editor button in the bottom-left corner of the Designer.

 

>

> private DataDynamics.ActiveReports.TextBox ReportDate;

>

>

>

> private void Initialize()

>

> {

>

> this.ReportDate =

> ((DataDynamics.ActiveReports.TextBox)rpt.Sections

[hd:"PageFooter"].Controls[hd:"Re

> portDate"]);

>

> }

>

>

>

> public void ActiveReport_ReportStart()

>

> {

>

> this.Initialize();

>

> this.ReportDate.Text = System.DateTime.Now.ToString();

>

> }

>

>

 

6.Preview the report. The current date and time should be displayed in the footer of each page.

 

The following documentation on ActiveReports for .NET explains an easier way to do this:

 

1.Add an ActiveReports TextBox control to your report.

2.Paste the following into the DataField property of the TextBox: =System.DateTime.Now.ToString()