Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i'm creating a crystal report which i need to display the foilio number,the current date and the branch code like this "E0410111300001". which is
E04 - is the branch code
101113 - current date
00000 - number of zeros (if folio number is in tenths then it will use the other zero)
1 - folio number


thanks guys
Posted
Comments
Chester Costa 11-Oct-13 5:51am    
i just used this totext function:
totext('E04') + totext({actualguesting.datecheckin},"mmddyy") +
totext({actualguesting.foilionum},0,'4')

but the result given to me is "E041011131"
it should be like this "E0410111300001"
Pheonyx 11-Oct-13 6:00am    
I've not see this "ToText" function before, I suggest you look at the solution I provided, it does the padding you require etc, I just do not know what your variable names are called.
Chester Costa 11-Oct-13 6:07am    
i used totext function in my crystal report formula sir.

You can use expression for the specific field.
like
iif(folio>9,"000" & folio,"0000" & folio)
 
Share this answer
 
Without knowing where the data comes from and what is stored where I can only advise the following:

C#
String.Format("{0}{1}{2}", BranchNoVariable, DateTime.Now.ToString(MMddyy),Folio.ToString("D8"))


This takes advantage of the following:

Pad Number with Leading Zeros[^]
String.Format Method[^]
Custom Date Formatting[^]

Hope that helps.
 
Share this answer
 
hahaha i just solved my own problem

totext('E04') + totext({actualguesting.datecheckin},"mmddyy") +
totext({actualguesting.foilionum},'00000')
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900