<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Field Alignment on Exported PDF or CSV Reports in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128285#M26337</link>
    <description>&lt;P&gt;I had the same issue and solved it with zero-width space code (&amp;amp; #8203;)  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval User = "&amp;amp; #8203;".User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Use it without space in code &lt;/P&gt;</description>
    <pubDate>Wed, 11 Sep 2019 12:19:45 GMT</pubDate>
    <dc:creator>iKate</dc:creator>
    <dc:date>2019-09-11T12:19:45Z</dc:date>
    <item>
      <title>Field Alignment on Exported PDF or CSV Reports</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128280#M26332</link>
      <description>&lt;P&gt;I setup a search query which will create a report on a daily basis. The report will be emailed as a PDF or CSV file. One of the columns in the report is Username. In my organization we have usernames that are all numeric as well as non-numeric usernames. On the report, the non-numeric usernames get aligned to the left while the numeric usernames get aligned to the right. This makes the report difficult to read.&lt;/P&gt;

&lt;P&gt;After doing a little research I discovered that this is by design. The PDF exporter is designed to align text fields to the left and numeric fields to the right. Is there a way to change this default behavior?&lt;/P&gt;

&lt;P&gt;I've taken a stab at this with no success. My first thought was to use the Eval - ToString() function as follows:&lt;/P&gt;

&lt;P&gt;Eval User=ToString(User)&lt;/P&gt;

&lt;P&gt;My thought was this would convert the numeric usernames to a string and they would therefore be left aligned in the report. To my dismay, the numeric usernames were still aligned to the right.&lt;/P&gt;

&lt;P&gt;I created another field in my report to verify the type of the field (numeric, string, etc...) by using this command:&lt;/P&gt;

&lt;P&gt;Eval Type=typeof(user)&lt;/P&gt;

&lt;P&gt;This command was placed directly after the ToString() command. I discovered that even after running the ToString() command, the field was still being identified as a "Number". I believe this is why the field is still being right aligned on my report. I have no idea why the ToString() command is not converting the field to a string.&lt;/P&gt;

&lt;P&gt;I must be doing something wrong. Is there a way to get numeric and non-numeric fields both left aligned on an exported PDF or CSV report?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;BR /&gt;
Joe&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:34:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128280#M26332</guid>
      <dc:creator>jmcelhin</dc:creator>
      <dc:date>2015-07-17T18:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Field Alignment on Exported PDF or CSV Reports</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128281#M26333</link>
      <description>&lt;P&gt;As a stab in the dark, try this mildly hacky thing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval User = " ".User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That'll prepend a space to the User field, forcing it into a string... which should normalize your alignment, assuming there's no sneaky optimizations hidden anywhere.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 23:38:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128281#M26333</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-17T23:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Field Alignment on Exported PDF or CSV Reports</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128282#M26334</link>
      <description>&lt;P&gt;Hey Martin,&lt;/P&gt;

&lt;P&gt;Thanks for the help.  I gave this a try this morning and it did successfully convert the numeric usernames to a string.  I verified this with the eval typeof() function.  Unfortunately, when I exported the report to a CSV or a PDF file the numeric fields were still aligned to the right.  There must be some code in the export utility that's superseding the conversion in the search.&lt;/P&gt;

&lt;P&gt;It's very odd behavior.  I'm sure there's a valid reason for it but it'd sure be nice to have the option to align the fields either way.&lt;/P&gt;

&lt;P&gt;I'm beginning to wonder if there's any way around it.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2015 12:28:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128282#M26334</guid>
      <dc:creator>jmcelhin</dc:creator>
      <dc:date>2015-07-20T12:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Field Alignment on Exported PDF or CSV Reports</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128283#M26335</link>
      <description>&lt;P&gt;That sounds as if something applied a &lt;CODE&gt;trim()&lt;/CODE&gt; to all fields and then the default string-to-number conversion kicked in... hmm. You could try prepending an underscore just to test the principle:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval User = "_".User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If this works we'll have to find another invisible character that doesn't get trimmed.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2015 22:25:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128283#M26335</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-20T22:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Field Alignment on Exported PDF or CSV Reports</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128284#M26336</link>
      <description>&lt;P&gt;Yeah, that works.  Do you know of any other invisible characters besides a space?  I tried a couple different ASCII characters I found online (0160, 255) but they pretty much equate to a space anyway and were trimmed off by the PDF exporter.  I may just have to live with prepending a character to the usernames.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 13:01:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128284#M26336</guid>
      <dc:creator>jmcelhin</dc:creator>
      <dc:date>2015-07-21T13:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Field Alignment on Exported PDF or CSV Reports</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128285#M26337</link>
      <description>&lt;P&gt;I had the same issue and solved it with zero-width space code (&amp;amp; #8203;)  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval User = "&amp;amp; #8203;".User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Use it without space in code &lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 12:19:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Alignment-on-Exported-PDF-or-CSV-Reports/m-p/128285#M26337</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2019-09-11T12:19:45Z</dc:date>
    </item>
  </channel>
</rss>

