Reporting service to export CSV

  • Hi,

    I am using SSRS to create a report. When this report is exported to a CSV file, it must make all columns the same width.

    So I am looking at creating a fixed-width column CSV file. I have created all the columns in the design view with the same width in centimeters - but this of course has not affect in a CSV's column widhts.

    How can I do this?

  • CSV files take no account of column width. This cannot be done. Are you talking about a fixed-width file?

    Have you posted in the wrong forum, by any chance?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • hmmm I have been getting that response from most people - that it can't be done.

    I am definitely talking about fixed-width: as in all the columns must be of equal length.

    So when you open the file in Notepad it will look something like this: (each column being 10 chars in width)

    abc ,12345 ,a1b2c3d4e5

    adhffg ,9876 ,kjkdkd

    asdfoplk ,84749 ,jjhtkjfll

    I have seen reports exported in this way before - that is why i am convinced there must be a way

  • To do this, you would actually have to pad the data with trailing spaces. SSRS will allow you to include the trailing spaces in the data and it will export it when you generate a csv file.

    This requirement is - weird. CSV files (or any delimited files) are not supposed to care about the width of the columns by design. This is actually one of the benefits over using a fixed width file. What is causing you to come to the conclusion that this is a requirement?

  • Thank you - trailing spaces will have to be my option then.

    I received this request from a client of ours and he (not being too IT literate) specifically asked for such a CSV and gave me an example of what he wants it to look like.

    The aligned commas (for each col having the same length) was a specific request from him.

    I agree with you that this request is, to say the least, WEIRD.

    Thanks for your help 🙂

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply