Skip to main content

Basic SSRS Expressions

Basic SSRS Expressions 







1.To add current date and time in report use the follwing code


now =Format(Now(), "MM/dd/yyyy hh:mm tt")


2.To add total number of pages after the page number use the following code


now ="Page "&Globals!PageNumber &" of "&Globals!TotalPages


3.To print date:


Format(Now, "dd/MM/yyyy")


4.To print time:


Format(Now, "hh:mm tt")


5.To print datetime use the following code:


=Format(Now, "dd/MM/yyyy") & vbCrLf & Format(Now, "hh:mm tt")


6.To print time depends on different time zones use the following code:


=Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, System.DateTime.UtcNow, "d", Parameters!AX_RenderingCulture.Value) & vbCrLf & Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, System.DateTime.UtcNow, "t", Parameters!AX_RenderingCulture.Value)


Comments

Popular posts from this blog

Total Amount of Purchase Order in X++

Method 1:  public AmountCur totalAmount()        // PurchLine       purchLine;         AmountCur       amountCur = 0;         while select crosscompany purchLine             index hint PurchLineIdx             where purchLine.PurchId         == purchtables.PurchId               && !purchLine.IsDeleted         {            // amountCur += purchLine.calcLineAmountExclTax(purchLine.PurchQty );                             amountCur += purchLine.calcLineAmount(purchLine.PurchQty + purchLine.ConfirmedTaxAmount );                          }         return amo...

Change Company

change company helps to chnage the value of our field on the mark of the entity value  suppose you are overding a value in 3005 when you change to 1005 and click button the value changes in 1005 too   class LegalEntityRestriction_FYCDeleteExistingEntries     {         /// <summary>         ///         /// </summary>         /// <returns></returns>         public boolean modified()         {             boolean ret;                      //ret = super();             LedgerParameters ledgerparameter;                  ret = super();             if(LegalEntityRestriction_FYCDeleteExistingEntries.valueStr( ) == enum2Str(NoYes::Yes))   ...

Split Method in X++

Split method is used to split value of a Name or Number using a decimal or comma so that we can separate them and use in fields in report or in form   public static void main (Args args)     {         str _Value,beforeDec,afterDec;         int x;         str str1='Jake,Grey';         Names names;          List strlist=new List(Types::String);         ListIterator iterator;           strlist=strSplit(str1,',');         iterator = new ListIterator(strlist);         while(iterator.more())         {             x= x+1;             if(x==1)             {                 beforeDec =iterator.value();           ...