Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export File Format

Status
Not open for further replies.

Hillary

Programmer
Feb 15, 2002
377
US
I have a crystal report which needs to be exported with specific field lengths. For example, the first couple columns are Student ID, Last Name and First Name. Their field lengths are 9, 20 and 20 respectivly.

Some students have 6 characters in their Student ID and some have 9 characters. How do I set up a "template" so there is always a 9 charcter space between the beginning of Student ID and the beginning of Last Name.

[tt]123456 MyLastName MyFirstName[/tt]
[tt]123456789AnotherLastName AnotherFirstName[/tt]

Thanks,


Hillary
 
hi
Create a formula
@Student_Id
Picture ({student_id},"xxxxxxx" )

cheers

pg

pgtek
 
But how do I ensure that there are no character spaces between Student ID and LastName?

Thanks,

Hillary
 
Hi
Create a formula
@Student_Id
Picture ({student_id},"xxxxxxx")+ " " + Last Name + " " + First Name

this will give u

student Id Last name First name
000000000_Last name_First name

the _ is 1 space between them

if you only have 6 characters in your id it will fill the blank with 00 to fill it to nine characters

cheers


pgtek
 
Sounds good but I don't want any extra 0 to fill the Student ID to nine characters. If there are only 6 characters then I only want to show 6 characters. See example from first post.

Thanks for your help,

Hillary
 
Hi

Ok
for your student id make sure you right justified the field
for the last name left justified
for the first name left justified

insert a text box in your report
then isert your studetn id first then hit the space bar that will a space then insert your last name
then hit the space bar to insert a space
then insert your first name
then format text box to can grow
you can ajust the space beteen them by adding more space bar

hope this helps

ex

student id last name first name
123456789 Brown Joe
123456 Molly Slip

cheers

pg

pgtek
 
pgtek,

I must not have been clear enough in what I need. I need all the columns to have set field lenghts and left justification.

What Export format do I use to get an ASCII look and feel?

Thanks again,


Hillary
 
hi
Just make the changes in the database
it's less problem

cheers



pgtek
 
hi
try this
Create a formula
@Student_Id
trim({student_id},"xxxxxxx")+ " " + Last Name + " " + First Name

cheers



pgtek
 
Hi Hillary -

You could use the space function to pad the fields. Something like:
Code:
{table.StudentID} + space(9-len({table.StudentID})) + {table.LastName} + space(20-len({table.LastName})) +
{table.FirstName} + space(20-len({table.FirstName}))



-Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top