0

I have a line of code to set the Report.PrintDate in VB6.How can we replace this line for CrystalDecisions.CrystalReports.Engine.ReportDocument ? In VB6 we have it is the inbuilt property for CRAXDRT.Report.

So can any once help me regarding this ?

Hemant Kumar
  • 4,593
  • 9
  • 56
  • 95

1 Answers1

2

if you want to show the current Date/Time of the printed report, you can use the built in Special Fields within the report designer . From your comment I understand you want to set that programatically. Then you need to create a Parameter and set it from code.

enter image description here

You can watch this DEMO to get to know how to create parameters. This Answer would show you how to pass the parameter from code.

Community
  • 1
  • 1
Abdusalam Ben Haj
  • 5,343
  • 5
  • 31
  • 45
  • Yes , Is there any property in CrystalDecisions.CrystalReports.Engine.ReportDocument to set the PrintDate Programmatically? – Hemant Kumar Jan 30 '13 at 13:24
  • @JaiGanesh See my updated answer, if you have any questions please ask. – Abdusalam Ben Haj Jan 30 '13 at 13:35
  • Thanks for your answer. Is there any possibility to set Programmatically> I found this link http://scn.sap.com/thread/1472366 – Hemant Kumar Jan 30 '13 at 13:39
  • @JaiGanesh I'm afraid the answer given in the link is incorrect, the PrintDate is a special field and can't be changed. Whats the problem with using parameters? – Abdusalam Ben Haj Jan 30 '13 at 13:49
  • @JaiGanesh See [This](http://stackoverflow.com/questions/3491487/change-crystal-report-printdate-field-to-sqlserver-date) question for example , if the date you are trying to set is coming from a database field, then you don't even need to set that from code, just use the bound field in the designer. – Abdusalam Ben Haj Jan 30 '13 at 13:51