<?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 SSRS Report in txt format in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/SSRS-Report-in-txt-format/m-p/4218121#M37913</link>
    <description>&lt;P&gt;I have created a ssrs report and end user wants the result in txt format.&lt;BR /&gt;I tried to export the report in csv and then convert it into txt tab delimited format.&lt;BR /&gt;But due to this the data and column name are getting misplaced.&lt;BR /&gt;Is there any way so that the data will remain aligned to Column name.&lt;/P&gt;</description>
    <pubDate>Fri, 04 Oct 2024 12:31:45 GMT</pubDate>
    <dc:creator>anmolmalviya05</dc:creator>
    <dc:date>2024-10-04T12:31:45Z</dc:date>
    <item>
      <title>SSRS Report in txt format</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/SSRS-Report-in-txt-format/m-p/4218121#M37913</link>
      <description>&lt;P&gt;I have created a ssrs report and end user wants the result in txt format.&lt;BR /&gt;I tried to export the report in csv and then convert it into txt tab delimited format.&lt;BR /&gt;But due to this the data and column name are getting misplaced.&lt;BR /&gt;Is there any way so that the data will remain aligned to Column name.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 12:31:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/SSRS-Report-in-txt-format/m-p/4218121#M37913</guid>
      <dc:creator>anmolmalviya05</dc:creator>
      <dc:date>2024-10-04T12:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: SSRS Report in txt format</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/SSRS-Report-in-txt-format/m-p/4218186#M37918</link>
      <description>&lt;P&gt;The whole point of a SSRS report (paginated report) is the page formatting with headers and footers etc.&amp;nbsp; It will be very hard if not impossible to convert that back into plain CSV.&amp;nbsp; &amp;nbsp;Can't you export the CSV from the data source directly?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 12:56:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/SSRS-Report-in-txt-format/m-p/4218186#M37918</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-10-04T12:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: SSRS Report in txt format</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/SSRS-Report-in-txt-format/m-p/4231536#M38025</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="693617" data-lia-user-login="anmolmalviya05" class="lia-mention lia-mention-user"&gt;anmolmalviya05&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from&amp;nbsp;lbendlin,&amp;nbsp;please allow me to provide another insight:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use PowerShell to convert the csv file to txt file. The test is as follows for your reference:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the cvs file I exported in SSRS.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;code in PowerShell:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# Define CSV file path
$csvFilePath = "Disk:\path\to\your\file.csv"
# Define output TXT file path
$txtFilePath = "Disk:\path\to\your\file.txt"

# Read CSV file
$csvData = Import-Csv -Path $csvFilePath -Delimiter ','

# Get the maximum length of each column
$maxLengths =$csvData[0].PSObject.Properties.Name.ForEach({
    $maxLength =$_.Length
    foreach ($row in $csvData) {
        $length =$row.$_.ToString().Length
        if ($length -gt $maxLength) {
            $maxLength =$length
        }
    }
    $maxLength
})

# Convert column names to a string with tab delimiters
$columnNames =$csvData[0].PSObject.Properties.Name.ForEach({
    $_.PadRight($maxLengths[$csvData[0].PSObject.Properties.Name.IndexOf($_)])
}) -join "`t"

# Convert CSV data to strings with tab delimiters, ensuring alignment
$txtData =$csvData.ForEach({
    $_.PSObject.Properties.ForEach({
        $_.Value.ToString().PadRight($maxLengths[$csvData[0].PSObject.Properties.Name.IndexOf($_.Name)])
    }) -join "`t"
})

# Combine column names and CSV data
$txtContent =$columnNames + "`r`n" + ($txtData -join "`r`n")

# Write content to TXT file
$txtContent | Out-File -FilePath $txtFilePath -Encoding ASCII&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Xu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 10:06:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/SSRS-Report-in-txt-format/m-p/4231536#M38025</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-07T10:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: SSRS Report in txt format</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/SSRS-Report-in-txt-format/m-p/4232837#M38035</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;Thanks for your response.&lt;BR /&gt;&lt;BR /&gt;The powershell script worked.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 04:32:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/SSRS-Report-in-txt-format/m-p/4232837#M38035</guid>
      <dc:creator>anmolmalviya05</dc:creator>
      <dc:date>2024-10-08T04:32:27Z</dc:date>
    </item>
  </channel>
</rss>

