Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Jan 25, 2011 5:53 am

Hello,
Can I just display the latter two of year when I insert data using formula with Spire.DOC?
For example, if I want to insert the data 2011.1.25, I just want to get 11.1.25 for displaying.
Thank you!

james
 
Posts: 8
Joined: Tue Dec 21, 2010 9:29 am

Tue Jan 25, 2011 9:25 am

Thank you for your inquiry!
yes, you can. To do this you can follow the source codes below:
Code: Select all
String currentFormula = "=NOW()";
   sheet.Range[1, 1].Text = currentFormula;
   sheet.Range[1, 2].Formula = currentFormula;
   sheet.Range[1, 2].Style.NumberFormat = "yy-MM-DD";
e-iceblue support
User avatar

iceblue support
 
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.Doc