Excel Archives -

Tag Archives: Excel

Adding Edit in Excel for List Parts or Custom Pages

Introduction: Business Central provides us an easy method of modifying our data from within Excel using Web Services commonly found in the Edit in Excel action. This can be seen in the commonly used List Pages for example Payment Terms. However this functionality can be missing for certain pages or you might want to have additional logic or filtering before executing this. For this I’ll be demonstrating how to add the “Edit in Excel” action in Business Central pages. References: Viewing and Editing in Excel From Business Central – Business Central | Microsoft Docs Using Filter Expressions in OData URIs – Dynamics NAV | Microsoft Docs Configuration: In the above piece of code, I’ve added the “Edit in Excel” action onto the Blanket Sales Order SubForm to allow for easily adding lines using Excel. Firstly, we define the filters that we will be using on the page that we will be passing in the “EditWorksheetInExcel” procedure of the “OdataUtility” codeunit. Note that these filters are defined as Odata expressions as the “Edit in Excel” functionality uses Excel behind the scenes. In the next lines, we see that we pass the Page Caption, the page ID and the filters to be set on the page. Under the hood, the procedure creates a Published Web Service using the provided Page ID and uses that for the data manipulation. We had to prepend the additional “00000” as the procedure has been hardcoded to use “COPYSTR(“00000″ + {PageID}, 5)” meaning it starts reading after the 5th character. Conclusion: Thus we saw how to configure Edit in Excel for pages that do not have built in Excel functionality. Also note that Microsoft is expanding the Excel functionality to List Parts from Business Central v19 Wave 2, you can read more about it here.

How to convert SQL table into Excel sheet and Excel sheet into a SQL Table

Introduction: Sometimes a user wants to analyze their SQL query results in Microsoft Excel or import existing Excel data sheets as tables in SQL in order to do various data transformations. In both scenarios we can achieve this goal as: Converting Data from SQL table to Excel sheet: Go to tools option on the toolbar on SSMS and select options. In the window that opens select Query Results. Select Results to Grid from the drop down. Check Include column headers when copying results from the checkbox and click on the ok button. Click on the intersection of first row and first column of the SQL Table to select the entire table and then copy it by pressing ctrl + C or by right clicking and selecting copy . Open a new excel sheet and just paste the contents after selecting the first cell. If some columns show values as ##### , just increase the column width. Converting Data from Excel sheet to SQL Table: Right click on the database where you want to import the excel sheet as table and go to tasks and select import data. Select Microsoft Excel as source from the dialog box Select the version of excel you want to convert into If the system gives error that microsoft.ace.oledb drivers are not found download it from Microsoft website based on what  driver version is required. Choose destination as SQL server Native client and enter the server name and credentials Select the sheet which you want to be converted into SQL as table. Click next Wait for the process to complete The new sheet is created as a table in SQL Conclusion: Thus we saw how we can convert SQL table into Excel sheet and vice versa Thank you very much for reading, hope you enjoyed the article!

Filter Error In Excel While Exporting SSRS Report From D365 CRM To Excel

Posted On October 10, 2018 by Simran Monteiro Posted in Tagged in , , ,

Introduction: Once a User exports a report to Microsoft Excel from a Microsoft Dynamics CRM environment, they may want to further filter the report in Microsoft Excel. Issue: An issue I came across recently was that the report, when exported to Excel, would not allow me to filter in Excel for the first few columns, as shown in the screenshot below. On further testing, I found that this was due to the Title text box above the table. Solution: Once the side of the text box was extended to the very end of the report (as shown above), near the end of the page, Excel allowed the filters to be applied to all columns in the exported SSRS report. That solves it!

How to split an ‘Address’ column into multiple columns in SSIS

Posted On December 29, 2017 by Simran Monteiro Posted in Tagged in , ,

Introduction: We can split an Address column into multiple columns for Flat Number, Building, Road, City etc. in order to make it easier to process the data. In order to do this, we can use the Derived Column Transformation in SSIS. Steps: In the screenshot below, you can see the Address column has an aggregated address for each employee. In your SSIS Package,  bring a Data Flow Task. Configure you Excel Source in Connection Manager and select the sheet you want the data from. Check in the Columns Tab to verify if the Columns are correct. Now drag the  Derived Column Transformation and connect the Excel Source to it. Double click the Derived Column Block and configure it as shown in the screenshot below. Flat: SUBSTRING([Col 2],1,FINDSTRING([Col 2],”,”,1) – 1) Building: SUBSTRING([Col 2],FINDSTRING([Col 2],”,”,1) + 1,((FINDSTRING([Col 2],”,”,2) – FINDSTRING([Col 2],”,”,1)) – 1)) Road: SUBSTRING([Col 2],FINDSTRING([Col 2],”,”,2) + 1,((FINDSTRING([Col 2],”,”,3) – FINDSTRING([Col 2],”,”,2)) – 1)) Area: SUBSTRING([Col 2],FINDSTRING([Col 2],”,”,3) + 1,((FINDSTRING([Col 2],”,”,4) – FINDSTRING([Col 2],”,”,3)) – 1)) City: SUBSTRING([Col 2],FINDSTRING([Col 2],”,”,4) + 1,((FINDSTRING([Col 2],”,”,5) – FINDSTRING([Col 2],”,”,4)) – 1)) PIN: SUBSTRING([Col 2],FINDSTRING([Col 2],”,”,5) + 1,((LEN([Col 2]) – FINDSTRING([Col 2],”,”,5)))) Once the configuration is done, connect Derived Column Transformation to you Target Block. Configure your Target Block to your Destination as shown below and check the Mappings to ensure the correct Source and Target columns are mapped. This is what your Data Flow should look like: Click on ‘Start’ when done. Once the execution is complete, check your Target Database for the desired output. Conclusion: This can be a requirement in many scenarios and by following the steps mentioned above, we can achieve the desired output.

SEARCH :

FOLLOW CLOUDFRONTS BLOG :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange