logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
siobhan  
#1 Posted : Monday, June 30, 2014 11:26:07 AM(UTC)
siobhan

Rank: Member

Groups: Registered
Joined: 6/5/2014(UTC)
Posts: 23
Ireland
Location: Dublin

Thanks: 1 times
Hi

I am currently trying to add Today's date to my Report header and this weeks Week Number.

I have successfully added my logo, Changed the Header Name but no matter which format I try to the Date it will not display. Is this possible?

Here are a few of my examples .... none of which work


<span class="title">"Daily Sales Report : " > < Date.Now() > </span>
<span class="title">"Daily Sales Report : " > "@Raw(Report.Translate("Now"))" </span> #
<span class="title">"Daily Sales Report : " > '@View.CultureInfo.DateTimeFormat.ShortDatePattern' </span>


Regards
Siobhan
epf  
#2 Posted : Tuesday, July 1, 2014 10:27:25 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 205 time(s) in 198 post(s)
Actually it is a pure c# problem..

I would suggest:
Code:
<span class="title">@DateTime.Now.ToString("d") @View.CultureInfo.Calendar.GetWeekOfYear(DateTime.Now, System.Globalization.CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday)</span>


You can get more about Date formatting at http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx

Getting the week number is more tricky but you can find lot of samples in Google...

epf
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.