x
login about faq Site discussion (meta-askssc)

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 '10 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 '10 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 '10 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 '10 at 01:47 PM

Mark gravatar image

Mark
2.6k 20 23 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.

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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x492
x29
x14
x14

asked: Jul 20 '10 at 01:11 PM

Seen: 1720 times

Last Updated: Jul 20 '10 at 01:11 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.