Custom font in SSRS Report



Install custom font in SSRS Report





In this blog, I will show you how to use custom fonts in Dynamics 365 for Finance and Operations reports, which Means fonts that are not part of your D365FO environment.

We can add the Custom font in AOS resources. D365FO server loads the font after your package deployment and treats those fonts as a systems-installed font.

Following are the simple step to use a custom font in the SSRS report in D365FO...


Step-1 Download any font you want to use in the SSRS report. in this tutorial for a demo, I am using the below Fonts.



  1. Romantisk Demo Regular
  2. Madpakke Demo Regular


Step-2 Create custom report like below  




Step-3 Now Add the resource file and add your downloaded font on the resource. each font required a separate resource file.

Here I am adding two resource files and assigning my font to them One by one.


Romantisk Demo Regular










Madpakke Demo Regular










The resource file looks like the below image.




Step-4 Now install the font on a development server. so it will available for you in Visual Studio for your development.






Step-5 Now add design in the report and add write any text then assign your custom font to your text. 




Step-6 Now perform build and deploy the report..

Step-7 Execute the report it will look like this.







Step-8 Now create the deployable package and deploy it on your D365FO Azure server :)

Please feel free to contact me if you are facing any issues during the implementation of this blog
 

Email In CC and BCC D365FO


Email In CC and BCC D365FO


As we all know the feature to send the email in CC and BCC is not yet available on UI, But the sysMailer class has the option to achieve the objective.

Here is the sample code:

class SLD_DemoInstance
{



    public void main(Args _args)
    {
      

        SysMailerMessageBuilder builder = new SysMailerMessageBuilder()
    .setFrom("shaikhsohailhussain@gmail.com")
    .addTo("to@example.com")
    .addCc("cc@example.com")
    .addBcc("bcc@example.com")
    .setSubject("Test")
    .setBody("Test email");
   
        SysMailerFactory::sendNonInteractive(builder.getMessage());

    }

}

Current language D365FO


Current language D365FO



static void main(Args _args)
{
info(companyinfo::languageId());

// user
    info(new xInfo().language());
    // system

    info(SystemParameters::getSystemLanguageId());

}

Camel case on SSRS Report Expression, D365FO




Camel case on SSRS Report Expression



Today I found a very good function in SSRS reporting services, which  Converts the first letter of every word in string to uppercase.



=StrConv(Fields!Name.Value,3)



But using “strConv” function we can simply achieve.

Here is the syntax:

=StrConv(Fields!Name.Value, vbProperCase)   
or

=StrConv(Fields!Name.Value,3)

D365FO Database Synchronization


D365FO Database Synchronization


In Microsoft D365FO there are 3 ways to synchronize the database 

Full synchronization
Synchronization after building of packages
DB sync on project build


Full synchronization

To perform a single full database synchronization Open Visual Studio and click on Dynamics 365 Menu and click on the synchronized database...

Like below 

Now click on synchronize
 

Synchronization after build of packages

There is an option available to sync the database with the build model feature, In this option DB with start sync after the building of the model...

Navigation

Go To > Dynamics 365 > Build model 


Now select model/models then click on the 2nd tab and Mark checkbox of the synchronized database.



DB sync on project build

The properties of a project in Solution Explorer, there is property available synchronized database of every build of the project.


D365FO One Box VM SQL Password


D365FO One Box VM SQL Password


We can open SQL Server Management Studio on you D365FO Local machine Via Windows Authentication and Using SQL server Authentication...


Window Authentication 

For windows Authentication you have to open SQL server as Run as Administrator otherwise you will get authentication Error...


SQL Server Management Authentication

For SQL server Authentication, Use below user name & password

USERNAMEAOSUSER
PASSWORDAOSWebSite@123


Passing values between PreHandler & PostHandler



Passing values between PreHandler & PostHandler 


using the below code you can pass the custom value between pre handler and post handler


Example


  /// <summary>
    /// enforcePayRateTolerance pre event hanlder
    /// </summary>
    /// <param name="args">Event args</param>
    [PreHandlerFor(tableStr(HRMCompFixedPlanTable), tableMethodStr(HRMCompFixedPlanTable, enforcePayRateTolerance))]
    public static void HRMCompFixedPlanTable_Pre_enforcePayRateTolerance(XppPrePostArgs args)
    {
   

        args.addArg("Tolerance", "Sheikh Sohail Hussain");

    }







 Example
    /// <summary>
    /// enforcePayRateTolerance post event hanlder
    /// </summary>
    /// <param name="args">Event args</param>
    [PostHandlerFor(tableStr(HRMCompFixedPlanTable), tableMethodStr(HRMCompFixedPlanTable, enforcePayRateTolerance))]
    public static void HRMCompFixedPlanTable_Post_enforcePayRateTolerance(XppPrePostArgs args)
    {
      

        if (args.existsArg("Tolerance"))
        {
           Info( args.getArg("Tolerance"))

     
        }
    }

Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...