Skip to main content
Dynamics 365 Community / Blogs / Jesús Almaraz blog / An empty layout and How to ...

An empty layout and How to set your VSCode diagnostics

Introduction

This post is about extension to set your own diagnostics https://marketplace.visualstudio.com/items?itemName=JessAlmarazMartin.customdiagnostics and is the follow up of https://community.dynamics.com/blogs/post?postid=38a1478a-5e90-4cac-9c7f-0069e6476a7c
Also other features of this extension are described in this post: https://community.dynamics.com/blogs/post?postid=9942e2b2-6405-4a72-936b-ae3086b3a81a and there are other features to discover that will be detailed in the future (fixes).
 

An Empty layout


This week the community complained about standard errors, and claimed for some reports with blank output, purchase return shipment and account balance.For developers it is easy to make this mistake, if you don't fill properly in the RDLCLayout property the path of the report there will be two layouts, one of them an empty layout.
RDLCLayout = './src/report/layout/ClosingTrialBalance.rdlc';
I have this pain lots of times because migrating reports the path of the layout is settled in a very random way, creating an empty one.
 

How to avoid that?


With my extension we created a new rule:
        {
            "code": "JAMMIG021",
            "message": "Layout vacio: revise la configuración del report y su properdad layout",
            "searchExpresion": "<Report xmlns",
            "skipFromSearchIfMatch": "",
            "severity": "error",
            "language": "xml",
            "skipIfFileInclude":
            [
               {
                  "searchExpresion": "Textbox"
               }
            ]            
        }
The key lines are, first the match to activate the diagnostic:
            "searchExpresion": "<Report xmlns",
If we find in a xml the expression “Report xmlns” the diagnostic is activated, but if we find some field declaration the layout is not empty, so then we won´t raise the diagnostic. We can do it this way:
            "skipIfFileInclude":
            [
               {
                  "searchExpresion": "Textbox"
               }
            ]            
If we set this diagnostic rule, when exists an empty layout the problem panel will warn us this error, as shown below:

Comments

*This post is locked for comments