Hi friend,
i don't wanted to do it in design mode. i wanted to do it at run time so that any user can select any date format from the dropdown provided by me.
Anyway i've found the solution.
First i created a variable 'DateFormat' in settings.settings file of type string under user scope.
Then whatever the date format is selected from the dropdown, i assigned to 'Properties.Settings.Default.DateFormat' which is created above.
Now, in crystal report i created a FormulaField 'CurrentDate' with value "".
In code, where we load the report, i wrote,
myReport.DataDefinition..FormulaFields["CurrentDate"].Text = "ToText(CurrentDateTime,'" + Services.Properties.Settings.Default.DateFormat + "')";
This is working fine now.
But can u give me an idea how to refresh the report page from my code ?
Thanks
Panna
|