x

fixed column width txt or csv output in ssrs

I have a client that wants their output in a fixed column width format when it comes to csv and txt. I have tried using a set number of spaces as the delimeter in the report.config file but this didnt produce the results I wanted, I have been researching into this for a while and I cant seem to find a solution. I know Microsoft doesnt provide a fixed width option in the CSV rendor, so I was wondering if anybody knows a trick i could use to make the columns look the same size.
more ▼

asked Jul 20, 2010 at 01:11 PM in Default

James Maddox gravatar image

James Maddox
1 3 3 3

Will the option to
 1. cast every column as char(size_somewhat_bigger than data), which will right-pad the data with spaces until they are of the specified size 2. use blank(emptry string) as a delimiter
work?
Jul 20, 2010 at 01:16 PM Oleg
no that wont work, the casting of the columns will mess with the integrity of the report and it also goes against our reporting standards, currently trying a blank space as a delimeter to see if it works
Jul 20, 2010 at 01:19 PM James Maddox
(comments are locked)
10|1200 characters needed characters left

1 answer: sort oldest

Can you use the LSet() function for each column? I just tested it and it worked for me.

=LSet(Fields!FirstName.Value, 40)
more ▼

answered Jul 20, 2010 at 01:47 PM

Mark gravatar image

Mark
2.6k 23 25 27

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x554
x35
x18
x18

asked: Jul 20, 2010 at 01:11 PM

Seen: 2493 times

Last Updated: Jul 20, 2010 at 01:11 PM