D365FO Reports with Electronic Reporting: Sharing my solution to stop using SSRS for NEW reports.

Since a while ago, I’ve been approaching the new requirements asking for reports directly using Electronic Reporting (ER), (goodbye SSRS, it was a really nice journey).

In order to create new reports easier I implemented a small “framework” (let’s put it that way) that I’ve been using in all the projects I had the need to create custom reports. It is a generic solution where you will only have to extend (inherit) a few classes, create a parameter to refer the format to execute and a menu item, as simple as that. I have decided to share it with you, so you might see how fast and convenient it could be to design in ER vs in SSRS.

My solution:

Here you are the link to my GitHub repository where you will be able to download the solution and adapt it to your project (changing prefixes etc.): RunERByCode GitHub.

In order to understand how to implement it and how it works, you may want to see the video explanation I recorded to make your life easier, or you can go below to see a quick high-level explanation in a step by step post format:

How to use it for anti-videos consumers

In the solution you will find the following objects:

And also you will find an implementation sample example:

Steps after importing the solution and addapt it (changing names, prefixes…)

Code implementation

First of all you will need to provide a place where the Format to execute will be setup, (use the EDT ERFormatMappingID). In the example I added it to the PurchParameters table.

As you might see in the implementation sample, next you will need to extend (inherit) the generic Contract, Controller and Service. In the contract you will add the parameters you want to have for your report execution. In the controller child you will just need to override the abstract methods and to provide a main that calls the method runReportController().

In the service, just call the abstract class method executeERReport sending the specific contract created before.

To finish, just create a menu item action calling your controller and place it where you need it.

That’s basically All you need from a code perspective. A place to setup the format to execute, and these 3 children classes.

ER Implementation

Now it’s just a matter of creating your ER. If you don’t know how to do it, check the ER from scratch series in the blog. In addition there are a few things worth to mention. In the solution there’s a few parameters added to the format setup, that will be needed for your ER to be executable from your code:

Where the call from code with contract needs to be set to yes, and then it will ask for a model node name and a Contract parameters model name.

The model name can be found in the format design:

under the mapping tab, it is the name that you put to the model node.

The Contract parameters model name is the name of the DataContract node (that should be based in the data contract that you implemented), and it should be added to the model mapping:

That’s the way you will send to the ER the parameters from the code, so make sure you use them to filter the information needed.

That’s all! I hope you find it easy.

Say goodbye to SSRS

With this solution you won’t want to create a new SSRS never again, and that added to the fact that we can change easily existing reports using Business documents and that we have the power of ER Destinations results in a scenario where I see few probabilities of me making the decission of matching a requirement with SSRS in the future.

Let me know your thoughs!


7 thoughts on “D365FO Reports with Electronic Reporting: Sharing my solution to stop using SSRS for NEW reports.

  1. Hola Fernando!
    Muy buen material el que tienes por aquí. Estoy intentando seguir los pasos de este post, pero tengo problemas a la hora de asignar formato al modelo.

    Puedo crear el modelo sin problemas y todo parece correcto, pero cuando voy a intentar en el diseño mapear lo datos (lo que sería el minuto 16:23 en el vídeo) me aparece que el modelo está vacío, en concreto el mensaje es “No se han encontrado elementos que mostrar aquí”. El campo “Root Definition” sí que tiene el nombre de mi modelo.

    Si embargo, si creo un formato con el modelo, en la parte de asiganción SÍ me aparece el modelo con sus nodos
    ¯\_(ツ)_/¯
    ¿Te ha pasado algo similar alguna vez?

    Like

    1. hmmm… si he entendido bien la pregunta tienes que crear el nodo del modelo en la parte derecha. (seleccionando la ultima definicion del modelo completado que tengas). Muchas gracias por ver el video/post, y por el comentario! Ya me dices si eso te ayudó, si no, necesitaría más detalles, muchas gracias.

      Like

  2. Hola Fernando, gracias por la respuesta tan rápida.
    No veo ninguna opción para crear el nodo del modelo.

    Así está creado el modelo:
    https://ibb.co/9t18Ppj

    Luego la creación en el diseño:
    https://ibb.co/Mp7SkgH

    Y lo que me aparece en el diseño o mapeo:
    https://ibb.co/3dfVk7V

    Que es lo que me está dando problemas, como puedes ver, aparece el nombre del modelo, pero no sale ningún nodo al que enlazar datos, ¿no sé si estoy haciendo algo mal?
    He probado de todas las maneras posibles, creando la asignación como nos enseñas en el vídeo y también haciéndolo en una asignación que cuelgue del modelo creado. En todos los casos obtengo el mismo resultado.

    Como curiosidad te paso otra captura del modelo en el caso de crear un formato colgando del modelo creado:
    https://ibb.co/ZKky6Gg

    Entiendo que si en un sitio aparece y en otro no, algo yo debo estar haciendo mal, pero no identifico el qué.

    Muchas gracias por tu ayuda!!

    Like

    1. Sinceramente no se qué estás haciendo diferente, recomendaría hacerlo de cero/ completar el modelo antes de entrar al model mapping. Si quieres podemos ver otra forma de comunicación más ágil, para poder ayudar a desbloquearte.
      Muchas gracias!

      Like

  3. Muchas Gracias por tu ayuda Fernando!
    Por si a alguien más le pasa, el problema era que en la distribución del modelo tenía seleccionado en la parte superior que se mostraran sólo los campos asignados “Mostrar sólo asignados”, por eso no me aparecía nada.
    Un saludo!

    Liked by 1 person

Leave a comment