How to display date in UltraWinGrid SummaryRow in MM-dd-yyyy? - c#-4.0

I am using UltraWinGrid and displaying the sum of the values using the SummaryRow. I need to display the maximum date in the summary row in MM-dd-yyyy format. Only date should be there. How to achieve this. Thanks in advance...

I got the answer form the site
http://www.csharp-examples.net/string-format-datetime/
SummarySettings SumSummary = new SummarySettings();
e.Layout.Bands[0].Columns["DateColumn"].AllowRowSummaries = AllowRowSummaries.False;
SumSummary = e.Layout.Bands[0].Summaries.Add(SummaryType.Minimum, e.Layout.Bands[0].Columns["DateColumn"]);
SumSummary.DisplayFormat = "{0:dd-MM-yyyy}";

Related

Set thousand separator Apache POI

I'm triying to format the number on my report with Apache poi but it is not working, I tried :
c.getCellStyle().setDataFormat(HSSFDataFormat.getBuiltinFormat("#.##0,00"));
and
c.getCellStyle().setDataFormat((short)BuiltinFormats.getBuiltinFormat("#.##0,00"));
But they are not working,
I'd like to show it as 1.000,99 but it is showwing 1000,99
I've only found the custom option but not the numeric, is it possible to use it ?do you know how to do it work?
Thanks
I got it. This is my solution :
DataFormat format = workbook.createDataFormat();
CellStyle style = workbook.createCellStyle();
style.setDataFormat(format.getFormat("#,##0.00"));
...
Cell c = row.createCell(cellDynamicNum);
c.setCellStyle(style);

In C#, Excel cell's custom date format not working with EPPlus

I'm having trouble with Excel's custom format using EPPLUS. Here's my code:
var destFile = new FileInfo(#"C:\temp\test1.xlsx");
var fileName = "test1";
using (ExcelPackage pck = new ExcelPackage(destFile))
{
pck.Workbook.Worksheets.Add(fileName); // Create the worksheet in package
pck.Workbook.Worksheets[fileName].Cells["A2"].Value = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss");
pck.Workbook.Worksheets[fileName].Cells["A2"].Style.Numberformat.Format = "d-mmm-yy";
pck.Save();
}
I'm getting the following:
The custom format is showed right, but the value in the cell doesn't display the format needed. Here's what I'm trying to get:
Note: I need the full date value DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss") for other files, but the custom format is all I need for this file.
What do I need to change to get this to work?
Thanks to #PaullAbbott, here's the correct answer:
pck.Workbook.Worksheets[fileName].Cells["A2"].Value = DateTime.Now;
This displays the results that I needed.

XPages date only fieldonly

Is it possible to create a date only field in XPages? I have tried the following in the querySaveDocument event but the field still ends up with a time portion of 00:00:00
var notesDoc:NotesDocument = document1.getDocument();
var dt:NotesDateTime = session.createDateTime(#Today());
dt.setAnyTime();
notesDoc.replaceItemValue("MyDateField", dt);
It is not completely clear what you are trying achieve.
You can put an EditBox component on your XPage, then go to the "Data" tab. From there you can change the formatting from String to Date. More options should appear on how to format the date in the field. It will handle passing the date to the back end document.
If it is you want to write directly to the back end document, then here is a page listing samples on working with NotesDateTime.
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/NotesDateTime_sample_JavaScript_code_for_XPages
Here is code by Sven:
ndt = session.createDateTime(ndt.getDateOnly());
item.setDateTimeValue(ndt);
error in date items, daylight Saving
Update:
I had to do the same thing and found out that it's working this way in Java agent in 8.5.2FP3:
DateTime dt = session.createDateTime(new java.util.Date());
dt.setAnyTime();
doc.appendItemValue("DT", dt);

JXL datetime no need the part time

Hello i wrote this code to add a Date in excel but when the cell is added he show also the time. I want eliminated the time part. Thank you in advance if someone can help ..
Tabla[tabReg][tabCol]); is String Array
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date convertedDate = dateFormat.parse(Tabla[tabReg][tabCol]);
DateFormat df = new DateFormat("yyyy/MM/dd");
WritableCellFormat wdf = new WritableCellFormat(df);
cf = new WritableCellFormat(df);
cell = new jxl.write.DateTime(exCol,exReg, convertedDate);
cell.setCellFormat(wdf);
sheet2.addCell(cell);
The solution was to put the format when you create de cell.
cell = new jxl.write.DateTime(exCol,exReg, convertedDate,wdf);

How to get a date selector when using the DocuSign API to add a date tab dynamically?

I am trying to create a Date using the DocuSign API where it mimics the Text field with Validation set to Date and then one of the three support "Validation date mask". When I submit the api request using the ValidationPattern of "^[0-9]{4}/((|0)[1-9]|1[0-2])/((|0)[1-9]|[1-2][0-9]|3[0-1])$"...it does not give me the calendar selector like the when I drag a date in the form editor.
Date date = new Date();
date.DocumentId = "1";
date.PageNumber = "1";
date.RecipientId = "1";
date.XPosition = "100";
date.YPosition = "100";
date.TabLabel = "txtbx_code_date_yyyymmdd";
date.ValidationPattern = "^(|by DocuSign)[0-9]{4}\\/((|0)[1-9]|1[0-2])\\/((|0)[1-9]|[1-2][0-9]|3[0-1])$";
date.ValidationMessage = "YYYY/MM/DD";
What am I doing wrong?
Thanks
jlimited.
The Date tab is also know as "Date Signed" and is auto-populated with the date when the recipient/signer signs the document, you cannot make it editable to the user.
You can use a text tab with your validation pattern for your needs instead.

Resources