How to create a Gantt Chart or Progress bar inside a Table in SSRS
In this article, we will create a Gantt Chart or Progress bar inside a table in SSRS . In SQL Server Reporting Service does not allow a report programmer to modify a “width” property at run time. The challenging part of this task is how to create a scale and how to create a progress bar that spans a start date and end date. But SSRS have a range bar chart that will help you to make a Gantt chart or progress bar. And display diamond shape if start date and end date is same. For creating Gantt chart, we need a Data source, a Dataset, a Table and a Range Bar chart. Steps Step 1: First create a new data source. Step 2: Before creating a data set, we need to write a Fetch XML query that created the data we’re going to work with. Fetch XML Query: <fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”false”> <entity name=”milestone”> <attribute name=”createdon” /> <attribute name=”item” /> <attribute name=”projectid” /> <attribute name=”contractorid” /> <attribute name=”packageid” /> <attribute name=”startdatemilestone” /> <attribute name=”remarks” /> <attribute name=”finishdatemilestone” /> <attribute name=”startdateforecast” /> <attribute name=”finishdateforecast” /> <attribute name=”startdateactual” /> <attribute name=”finishdateactual” /> <attribute name=”progress” /> <attribute name=”status” /> <attribute name=”durationdays” /> <attribute name=”sequencenumber” /> <attribute name=”milestoneid” /> <order attribute=”item” descending=”false” /> <filter type=”and”> <condition attribute=”projectid” operator=”eq” uiname=”ABC” uitype=”pmtracker” value=”{86AF05D9-6962-E911-A834-000D3A07F3D7}” /> </filter> </entity> </fetch> This gives us a result set like this : Sequence Number Item Package Start Date(Milestone) Finish Date(Milestone) Start Date(Forecast) Finish Date(Forecast) Start Date(Actual) Finish Date(Actual) Duration(Days) Status 1 Concept Design Lighting 02-01-2019 06-02-2019 03-01-2019 09-02-2019 03-01-2019 09-02-2019 37.00 Completed 2 Concept Design approval Lighting 13-02-2019 13-02-2019 07-02-2019 14-02-2019 07-02-2019 13-02-2019 6.00 Completed 3 Detail Design Lighting 14-02-2019 17-04-2019 14-02-2019 17-02-2019 14-02-2019 18-02-2019 4.00 Completed 4 Detail Design Approval Lighting 17-04-2019 23-04-2019 17-04-2019 24-04-2019 17-04-2019 22-04-2019 Delay 5 Tender Issue Lighting 29-05-2019 31-05-2019 01-06-2019 03-06-2019 01-06-2019 03-06-2019 Delay 6 Tender Return Lighting 31-05-2019 22-06-2019 03-06-2019 03-06-2019 03-06-2019 24-06-2019 21.00 Completed Step 3: Now we create a Data set from this query: If start date and end date is same then need to display diamond shape, for that we have to add three calculated field. Need to find number of days between two dates. DayDiff_MileStone=DateDiff(“d”,Fields!startdatemilestoneValue.Value,Fields!finishdatemilestoneValue.Value) we are going to set the following properties: We’re going to create a table within the report that has a column for each of the columns in the data set, plus a column for a graph. We just have to bind the Table to the data set “MilstoneData” Then drag the columns of the data set to the columns of the table. Step 4 : Build the Gantt Chart SSRS have the Range Bar Chart option. Just drop the chart onto a blank area of the report. We’ll fit it into table later. Now we are going to take fewer part of the chart. We’re throw away of: The chart title The legend The vertical Axis title The vertical axis The horizontal axis title When we’re done, the chart should look like this: Let’s start setting up the chart. The first thing we need to do is set the Minimums, Maximums, Intervals and Interval Types. The client wants minimum date must be from “startdatemilestone” date and maximum date should be “finishdateforecast” date. On the Horizontal Axis, we are going to set the following properties: Minimum =DateSerial(Year(Min(Fields!startdatemilestoneValue.Value, “MilestoneData”)), Month(Min(Fields!startdatemilestoneValue.Value, “MilestoneData”)), -1) Maximum =DateSerial(Year(Max(Fields!finishdateforecastValue.Value, “MilestoneData”)), Month(Max(Fields!finishdateforecastValue.Value, “MilestoneData”)) , 0) Interval 1 Interval Type Months Also going to set the format the of items along the Horizontal Axis to MM-yyyy Go to chart series properties, set Marker properties. Let’s get a preview of the report and see how we’re doing. It’s correct, but it doesn’t provide the milestone data. Now cut the chart and paste it into the details row of the Table, in the right most column. Now we’re going to run a preview. OOPS! We receive the error “The chart has a detail member with inner members. Detail members can only contain static members. What this means is that chart cannot live in a detail row. We’re going to create a Group that contains only a single Item. After selecting the Table, at the bottom left of the screen, we find “Row Groups”, Just click on preview shows us: Nice-looking but do we really need a timeline on every now? Now we are going to need a timeline. So, let’s take a copy of the Chart and put it right next to the header “Duration” Now we can hide the Axis Labels on the chart in the footer. We can also change the Axis line style to none. Click on preview Wow! Hope this helps you! Check out my other blog here https://www.cloudfronts.com/performing-update-operation-in-microsoft-dynamics-nav-through-integration-in-scribe-online/
Share Story :
How to Attach Word Template to Notes of record Automatically
Introduction: In this blog, we will look into How to Create Word Template Automatically and attach it to Notes. Steps to attach Word Template Using Workflow Navigate to Solution > Processes > Click on New > Enter your Process name, Select Workflow as your Category, Enter your Entity (Account), Check the button (Run this Workflow in the background) > Click on OK I have created a Custom Field as Status. I want this workflow to run when this field is updated, So Check the Record fields change > Select the Status Field State the condition on which you want to trigger the workflow. Select Perform action > Select Action(Set Word Template) > Click on Set Properties Select your Word Template in “SelectedTemplate” and in Target select the “Entity”. If you cannot set Entity Name in “Target” make sure “Business process flows” properties of that entity is enabled. Save the Word Template Activate the Workflow. Output: Update the Status field Automatically the Note is created with word template
Share Story :
Notes attachments in Word Template
Introduction : This blog explains how to add notes attachments in word template. Implementation : Let say we have word template on the account entity and we want to add attached notes in word template. Step 1: a. Create record( if no record is there) for an account entity. b. Select the record and download the word template. Step 2 : Select notes- annotation(1:N) relationship and Download. Step 3 : Open Word Template, Navigate to “Developer” ->Select “XML Mapping Pane” -> Select entity . Step 4 : Then insert a table in the template , here inserting 2×1 table. and then in the XML mapping, go to Account_Annotation relation. Step 5: Map document body and note text a. For text in word template, left-click on the note text and select plain text. b.For the image in word template, left click on the document body and select Picture. Step 6 : Save and Upload the Template. To upload the Template – a. Go to advanced settings -> navigate to “Template”. b. In Templates, Select Document Template. c. In Document Template, click on Upload Template and browse. d. Upload.
Share Story :
How to Replicate D365 View using XRM Tool
Introduction: In this blog we will look into How to Replicate your View to all the Views Steps: Navigate to Solution > Expand the Entity (Account) > Views > Click on Quick Find Active Account Click On Add View Columns3. You can Add fields for the view based on what you want to view.4. You can modify the width by clicking on the column name and then click Change Column Properties. Choose the quantity of pixels you’d just like the width of the column to seem as in the view.5. Click on Save And Close and then Publish your Customization Replicate View to all other Views Together To Copy the views Start Your XRM toolbox > Connect to your organization. Search View Layout Replicator Click on Load Entities > Click on your Entity (Account) > Click on Quick Find Active Accounts. Check all your customization’s are correct, Then select all the views which you want to get reflected Save and Publish your View
Share Story :
How to make same record available in two different Organization / Environment? Part 2
Please refer to my previous blog better understand why the same records are required in two different Organizations or Environments. Click Here Import Phase: Login to Destination Environment in which you want to import the Data with the same GUID. In Destination Environment, Open the Entity View and click on right three dots for import options. Click on the > which is present on the right side of “Import from Excel” Click on the Import from CSV You will get the Screen like shown in below Screen and now you have to select the file and click on Next You will get the Screen as shown in the below Screenshot. Now, click on the Review mapping. After Clicking on the Review Mapping you must map the column header to fields of Entity. Now, here comes the most important of this blog. Here you have a map the column which has the GUID of the entity to Entity name present in the Destination Environment. Here I have mapped Customer Header (having GUID) to Customer (Entity Name). You can ignore the mapping of “Created On” Date or else you can map it will “Record Created On”. Click on the Finish Import and see the magic. All the Data will be imported with the same GUID as of source Environment. You can see the imported data in the following screenshot. To check whether the GUID of records present on both the Environment is the same or not. Just export data from both the Environment and match the GUID of each record. Below you can see the GUID of imported and exported records are the same. Following is exported Data from Source Environment. Following is exported Data from Destination Environment.
Share Story :
How to use System.Text.Json APIs in Asp.net
Initially for parsing object to Json or json to object in Asp.net an additional Newtonsoft.Json Api was required, but now Microsoft has developed their own Apis “System.Test.Json”. Below Steps will guide you on how to use this api. Install the System.Text.Json NuGet package. To use the api make sure you import the following two namespaces: using System.Text.Json; using System.Text.Json.Serialization; Using the serializer as follows: The System.Text.Json serializer can read and write JSON asynchronously and is optimized for UTF-8 text, making it ideal for REST API and back-end applications. class WeatherForecast { public DateTimeOffset Date {get; set;} public int TemperatureC {get; set;} public string Summary {get; set;} } string Serialize (WeatherForecast value) { return JsonSerializer.ToString<WeatherForecast>(value); } Api also support asynchronous serialization and deserialization. async Task SerializeAsync(WeatherForecast value, Stream stream) { await JsonSerializer.WriteAsync<WeatherForecast> (value, stream); } You can also use custom attributes to control serialization behavior, for example, ignoring properties and specifying the name of the property in the JSON: class WeatherForecast { public DateTimeOffset Date {get; set;} // Always in Celsius. [JsonPropertyName(“temp”)] public int TemperatureC {get; set;} public string Summary {get; set;} // Don’t serialize this property. [JsonIgnore] public bool IsHot => TemperatureC >= 30; } Note: In the above point isHot property will not get parsed to json and json will look like below: { “date”: “2013-01-07T00:00:00Z”, “temp”: 23, }
Share Story :
How to integrate OneDrive for Business with Dynamics 365
Most of the organization are using the built-in integration between Dynamics 365 and SharePoint, which allows the organization to manage and store documents in SharePoint. Microsoft has expanded the document management capabilities for Dynamics 365 with the built-in integration of Dynamics 365 with OneDrive for Business. With this integration, users can manage the documents for the D365 CE entities from their OneDrive for Business. In this article, we are going to see how to enable Dynamics 365 integration with OneDrive for Business. IT Considerations: No additional software required. You need to have the System Administration role in Dynamics 365 to enable OneDrive for Business integration with D365. Users must have a SharePoint Online license. Enabling D365 integration with OneDrive for Business: Go to Settings > Document Management > Enable OneDrive for Business. Tick on Enable OneDrive for Business and click OK. After enabling OneDrive for Business, you can see OneDrive for Business Folder Settings, in which you can define the folder which will be used for storing the Dynamics 365 documents in your OneDrive for Business. You can see the default folder as /CRM. Go to Dynamics 365 records > Related > Documents. In the Document Location, you will see two folders appeared. OneDrive – From here you can save the document in OneDrive CRM Shared with me – Files shared with you for the associated record will be shown here. Using OneDrive for Business for Dynamics 365 Entities: Once you are in the Document Location of a record, you can create or upload the document in OneDrive. You will need to first select OneDrive in Document Location. In this case, I am uploading a document to OneDrive for an Opportunity. When I select All locations, I will be able to see all the documents associated with this record. The above-uploaded document has now been associated with this Opportunity. Here is how the folder gets created in your OneDrive for Business. The folder structure will be like CRM > Opportunity > Record. Now, let’s see if the other user can access the OneDrive document I uploaded for the record. I went to the same record and selected All locations. So, the user is only able to see the files on SharePoint. Let’s try to share this file with the user and see if it is accessible after sharing. When the file was shared with other users, the document is now visible under Shared with me a folder or under All locations in the D365 record. You can check the source; it says Shared with Me. This is how we can integrate Dynamics 365 CE with OneDrive for Business and can associate their documents with D365 for Customer Engagement records which any other individual will not be able to see unless the file is shared.
Share Story :
10 Best Practices for implementing HTML web resources with Dynamics 365 CRM
Do not use any CDN links for any .js or .css file, include them in your own project. Do not give multiple references of any .js or .css file on the same HTML. If any .js or .css file is going to be used on multiple Html web resources, then keep them at one common location and include the same URL reference on all the HTML page, do not try to create same web resources repeatedly. Always try to write minimum codes and re-use the code where possible. Always try to use objects where possible. Minimize the use of global variables (use local variables). Avoid multiple API hits try to get maximum data in a single hit where possible. Use joins in fetch XML queries to get data from all the related entity to avoid multiple API hits. Use Try and catch for exception handling. Minify .js and .css file before releasing the same on production.
Share Story :
Set Lookups in Xrm.WebApi D365 v9 correctly
Using Xrm.WebApi needs you to be careful with the field names and what to use when. Especially, when you are dealing with Lookups. One of the most common errors you’ll come across is the one like below – “An undeclared property (fieldname you entered) which only has property annotations in the payload but no property value was found in the payload.” This is confusing as to what needs to be put in while setting the lookup. If you have done the below, entered the name of the field which is all in small caps – object[“msdyn_resourcerequirement@odata.bind”] = “/msdyn_resourcerequirements(<Guid>)”; This will result in the above error!!! You’ll need to put the Schema name of the lookup field instead and this should solve your problem – and the code should look like this – object[“msdyn_ResourceRequirement@odata.bind”] = “/msdyn_resourcerequirements(<Guid>)”; And this should totally work for you!! Hope this helps! 🙂
Share Story :
Import multiple Users in Office 365
One of the common tasks to import multiple users in Office 365 is to be able to create multiple users in the most efficient way possible. Here’s a quick guide to doing so using Import multiple users feature in Office 365 Admin Center. Download Template for Importing Users Let’s say you are in the Admin Center using portal.office.com. Under Users, You’ll find a button to Add Multiple Users And the feature lets you download a template with some sample data in case you’re unsure of what to enter. Once downloaded, you’ll get the Excel in your system Now, you’ll see some sample data which you can simply delete to add your actual data. And let’s say, your data looks like this. I’ve added Kuldeep Gupta and Subhash Mahato, 2 users with some info. Import Back into O365 Now, we are set to import this in O365. On the same feature, look for Browser button to import. Click Verify to validate the info entered for any errors. Once verified, you can click Next. On the next step, I’ll assign licenses and proceed by clicking Next. Once the processing is done, users will be added And you’ll see 2 new users in O365 with the selected licenses Hope this was easy! 🙂