Export To excel a list view with some modification
Excel is getting downloaded well.
I want to add space at the end of the header: I have tried adding space like :Edit the header names and add spaces at the end of each header. For example, you can modify "Date" to "Date " by adding spaces at the end. Its not working
I want to Add this line as the first line Active Charges,,,,,,,,, Please provide solution if anyone knows on it
Page 1 / 1
It seems like the headers are always trimmed, the only work-around I could find was to make the header literal and add a special character at the end, like this:
Item Name
Hi Nagma_Nk
I do not think your 1st request is possible.
Sanitizing whitespaces out of data is good practice, perhaps some more detail on your requirements and we could assist you with another plan
Are you trying to create a heading for you excel data? If your data source is something like SQL then I suggest creating second List method. More detailed explanation below.
Consider the below SQL Table and corresponding SmartObject
Now I create a stored procedure to generate my new data
-- ============================================= -- Author: Francois -- Create date: 2023-11-07 -- Description: Lists data in oExcelExport]. Data] With additional Headers -- ============================================= CREATE OR ALTER PROCEDURE RExcelExport].UData.ListWithAdditionalHeaders] AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON;
-- temp table to store results and headers DECLARE @results TABLE ( EField1] nvarchar(200) NULL, 2Field2] nvarchar(200) NULL )
-- First we insert a header row INSERT INTO @results (RField1]) VALUES ('Active Charges,,,,,,,,,')
-- insert our data from our table next INSERT INTO @results (RField1], eField2]) SELECT )Field1] ,eField2] FROM eExcelExport].RData]
SELECT * FROM @results END GO
Add the method to my Smart Object
map the outputs/ inputs to existing properties
We change our export to excel rule to first call our new method and then export to excel
in the above I call the List method again.
Now the excel looks like this.
Let me know if this helps
Regards
I dont want it like this
I want it like this, Please find the below screenshot:
I do not think the Out of the Box functionality is going to work here.
I would recommend a custom integration that takes a template Excel file and populates a table in it.
This will required some form of Programming though.