Reporting Archives -

Tag Archives: Reporting

Power BI Custom Visual Sorting

Sorting can be used for defining an order direction for your Custom Visual. There are 3 different ways using which you or a user using your visual can sort your visual. They are as follows: Default Sorting: This is the easiest sorting option and gives users the ability to sort the visual by any field used in the visual. The following code needs to be added to the capabilities.json file.  “sorting”: { “default”: { } } After this the user will get the below sorting option: Implicit Sorting: Implicit Sorting can be used for pre-defining your sorting order in your capabilities.json file. Here, the user cannot manually change the sorting order. This can be done with the following code block where direction 1 is ascending and 2 is descending. Role is the data mapping name for which you would like to define your sorting. “sorting”: {         “implicit”: {             “clauses”: [                 {                     “role”: “category”,                     “direction”: 1                 }                 ]         }     } Custom Sorting: Custom sorting can be used for defining sorting in your visual.ts file and not in the capabilities.json file. Since you are defining your sorting order in your code, you can use various different logics to define your sorting(For example, you can define a formatting toggle option in the format pane that will sort the visual when turned on). A simple codeblock that can be used for sorting your datapoints in ascending order is as follows. sort((obj2, obj1) => { if (obj2.category< obj1.category)  return -1 else return 1; }); With so many options available, it is pretty easy create a visual just the way the user wants.

Count Number of weekends between 2 dates in SSRS

Problem: There is no in-built function in SSRS where we can count the number of Saturdays and Sundays between any two dates in SSRS. This is a needed function for scenarios where we only need to get a count of working days.’ Solution: Following is a formula that can be used for getting an accurate count of weekends. = (((DateDiff (DateInterval.Day, DateAdd(DateInterval.Day,7-WeekDay(Parameters!startDate.Value),Parameters!startDate.Value), DateAdd(DateInterval.Day,7-WeekDay(Parameters!endDate.Value),Parameters!endDate.Value).AddDays(1)) + 1)/ 7)*2) + iif(weekday(Parameters!endDate.Value)=7,1,0) + iif(weekday(Parameters!startDate.Value)=1,1,0) -1 Here instead of Parameters!startDate.Value and Parameters!endDate.Value, you can use any other Start Date or End Date.

Generating Image dynamically in SSRS Report from CRM

Introduction: It is possible to Fetch images from CRM’s entity records using Fetch XML.  This can be done using Notes attachment in CRM and the steps to display the Image in your report are pretty simple as well. Steps: Attach your image to a note under your respective entity in CRM In your Visual Studio copy paste the following code in your Query Designer <fetch mapping=”logical” output-format=”xml-platform” version=”1.0″> <entity name=”annotation”> <attribute name=”subject”/> <attribute name=”notetext”/> <attribute name=”filename”/> <attribute name=”filesize”/> <attribute name=”documentbody”/> <attribute name=”annotationid”/> <attribute name=”mimetype”/> <attribute name=”objectid”/> <filter type=”and”> <condition attribute=”mimetype” value=”%image%” operator=”like”/> </filter> <order descending=”false” attribute=”subject”/> </entity> </fetch> Add an Image Control in your Report. If you want to generate multiple images then you can add the Image Control under a Table Go to Image properties and select the image source as Database. Under field select documentbody and select your MIME type to whichever image format you want it to be  Click on preview and your image should be rendered in your report Conclusion: Thus you can store images in your CRM and generate dynamic SSRS reports with these images easily.

Row Numbering Issue for Grouped Data in SSRS

Issue: In SSRS if we are using an aggregate function in a group at the Tablix level, then you may realize that the simple row numbering function does not give a current sequential ranking. Using the function RowNumber(Nothing) gives something like this. Using RowNumber(“GroupName”) would also give an incorrect row numbering and look something like this. This is because RowNumber does not actually give the row count. Rather it counts the incidences of the data in the group and returns that value. Solution: We can use the “RunningValue” function in SSRS. The format for the expression would be. =RunningValue(<Grouped field>,CountDistinct,”<DataSet>”) Eg: =RunningValue(Fields!Name.Value,CountDistinct,”Accounts”) This would return something like this.   This should fix your issue!

SEARCH :

FOLLOW CLOUDFRONTS BLOG :

[gravityform id="36" ajax="true"]

FOLLOW CLOUDFRONTS BLOG :