0

In every page, I want to display Date of print. I have used new Date(), but it is showing system time of server. I want to display current system time (client).

How can print this in JR report?

Alex K
  • 22,315
  • 19
  • 108
  • 236
1097733
  • 467
  • 3
  • 9
  • 18
  • Are you talking about *JR Server* or about custom web-application hosted on a some application server? – Alex K Sep 14 '12 at 11:18
  • application server, for us it is located in different countries... – 1097733 Sep 14 '12 at 12:01
  • You can use applet for initializing datetime parameter on a client side. And then pass this parameter to the report – Alex K Sep 14 '12 at 12:21

1 Answers1

1

Don't use an applet, you can use a little JavaScript.

See this question: Auto insert date and time in form input field?

For example:

<form action="generate_report" method="post">
  <input id="report_date" name="report_date" />
</form>

<script type="text/javascript">
  document.getElementById('report_date').value = Date();
</script>

Pass the value of report_date into the report's parameter list.

Community
  • 1
  • 1
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315