# Report adding spaces in front of my strings from a query

**URL:** <https://forum.inductiveautomation.com/t/report-adding-spaces-in-front-of-my-strings-from-a-query/95482>\
**Category:** Ignition\
**Tags:** reporting\
**Created:** [September 3, 2024, 1:51pm UTC](https://forum.inductiveautomation.com/t/report-adding-spaces-in-front-of-my-strings-from-a-query/95482 "2024-09-03T13:51:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zach\_Larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zach_larson/32/54388_2.png) [@Zach\_Larson](https://forum.inductiveautomation.com/u/Zach_Larson)\
**Post date:** [September 3, 2024, 1:51pm UTC](https://forum.inductiveautomation.com/t/report-adding-spaces-in-front-of-my-strings-from-a-query/95482/1 "2024-09-03T13:51:16Z")

</div>

Data is coming from a query.  
I can query select part, trim(part), or ltrim(rtrim(part)).  
whatever I do, the report makes the column show up with spaces like:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/6/1640a2dcab6cdd6f040a0d98aa8f4a876548e7de.png)  
Which then makes the column appear incorrectly in the column.

8.1.42

I have tried:  
Making new queries  
Making new column names  
Various trim techniques  
Updating the table to set to the trimmed output  
Changing fonts and text size

Not sure what to try to fix it.

If I type in Test@Part@ for the column in the report table,then result is TES12345 without spacing, which is kind of frustrating, but maybe can help me fix it.

---

<div class="post-metadata">

**Author:** ![Zach\_Larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zach_larson/32/54388_2.png) [@Zach\_Larson](https://forum.inductiveautomation.com/u/Zach_Larson)\
**Post date:** [September 3, 2024, 2:18pm UTC](https://forum.inductiveautomation.com/t/report-adding-spaces-in-front-of-my-strings-from-a-query/95482/2 "2024-09-03T14:18:01Z")

</div>

`set Part = LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(REPLACE(Part, CHAR(10), CHAR(32)),CHAR(13), CHAR(32)),CHAR(160), CHAR(32)),CHAR(9),CHAR(32))))`

My data got contaminated with some kind of invisible character it seems. I was able to replace the hidden character with the above in sql.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [September 3, 2024, 2:23pm UTC](https://forum.inductiveautomation.com/t/report-adding-spaces-in-front-of-my-strings-from-a-query/95482/3 "2024-09-03T14:23:04Z")

</div>

I'd be inclined to figure out what's wrong with the data. Replace each of the control characters, one at a time, with an `*` to see what they are. Then fix the data. Otherwise it's likely to bite again.

---

<div class="post-metadata">

**Author:** ![Zach\_Larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zach_larson/32/54388_2.png) [@Zach\_Larson](https://forum.inductiveautomation.com/u/Zach_Larson)\
**Post date:** [September 3, 2024, 2:25pm UTC](https://forum.inductiveautomation.com/t/report-adding-spaces-in-front-of-my-strings-from-a-query/95482/4 "2024-09-03T14:25:43Z")

</div>

The strings were imported with the invisible character(s) from excel.  
I am sure this will come up again, the character is invisible from source, export, or excel.  
Trying to clean it before this afternoon.  
I think it did happen to me before, after you mentioned it, I vaguely recall a year ago maybe.
