This is a migrated thread and some comments may be shown as answers.

Date Conversion

4 Answers 1159 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Telerik User
Top achievements
Rank 2
Telerik User asked on 28 Jul 2008, 02:44 AM

can anyone knwos how to convert a sample date in a datafield?

for this sample
  my parameter is Start Date and End Date and i want to view it on one  datafield in header secti

Pag-Ibig Loan Remittance from “Start Date” to “End Date”

on


 

 Start Date: 01/01/2006 End Date: 01/31/2006

 Pag-Ibig Loan Remittance form 01/01/2006 to 01-31/2006


because as of now i try it and the output have time and it should be date only..


if are there any new function in telerik reporting?

such as getting the first,secong,third and fourth value in a data like a Parameter which is datatype is an integer?


sample: my parameter is : Pay Year (datatype is integer)
and input a 2006 in the parameter

the output should be shown on a 4 datafield and every filed there should be one value

like 

 

2

0

0

6





4 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 28 Jul 2008, 11:26 AM
Hi,

You can accomplish your tasks by using item binding Expressions. In them you can access directly the members of the .net objects to achieve the desired functionality. In your case some members of a DateTime and a string objects will be used.

Here are some sample solutions for the first problem:

1. ='From ' + Parameters.Parameter1.ToShortDateString() + ' to ' + Parameters.Parameter2.Date.ToShortDateString()
Using the system's short date time format string.

2.='From ' + Parameters.Parameter1.ToString('dd.MM.yyyy') + ' to ' + Parameters.Parameter2.Date.ToString('dd.MM.yyyy')
Using custom date-time format string.

and the solution for the second:

Each TextBox should have an expression which returns the corresponding figure of the 'year' number:
1. =Parameters.Parameter3.ToString().SubString(0,1)
2. =Parameters.Parameter3.ToString().SubString(1,1)
3. =Parameters.Parameter3.ToString().SubString(2,1)
4. =Parameters.Parameter3.ToString().SubString(3,1)

For more complex problems you can use User Functions.

A sample report is attached.

Regards,
Chavdar
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Telerik User
Top achievements
Rank 2
answered on 01 Aug 2008, 03:15 AM
How should i apply on a C# program?
0
Telerik User
Top achievements
Rank 2
answered on 01 Aug 2008, 03:15 AM
How should i apply on a C# program?
0
Chavdar
Telerik team
answered on 01 Aug 2008, 10:02 AM
Hi Telerik User,

The expressions do not depend on the programming language. You can use the Expression Editor to enter them directly.

Sincerely yours,
Chavdar
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Telerik User
Top achievements
Rank 2
Answers by
Chavdar
Telerik team
Telerik User
Top achievements
Rank 2
Share this question
or