Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Jul 6, 2021 8:39:20 AM
Jun 1, 2017 3:33:45 PM
When a date field is used for or inside a Level in Pixel Perfect, the output may not be interpreted as expected.
You expect to see something like: 2017/05/31
You actually see: yyyy/MM/dd
Environment:
This is the expected behavior of the underlying DEV Express platform upon which Pixel Perfect is designed
To resolve this, you need to perform some scripting on the 'date' field within the Pixel Perfect editor.
The scripting involves the following steps.
private void label1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
XRLabel label = (XRLabel)sender;
double x = Convert.ToDouble(label.Text);
DateTime myDate = DateTime.FromOADate(x);
label.Text=myDate.ToString("dd/MM/yyyy");
}
I'm grappling with this date issue with Levels in PixelPerfect, and the script solution isn't working, nor is wrapping the field with Text() in Sense. Hoping there's a newer solution... Using NPrinting May 2021 and Sense November 2021.
Hello @Lauri
I would recommend posting what you are having a challenge with in our NPritning Discussion forums. This way you can make use of our active community and support engineers monitoring the forums.
All the best,
Sonja