Solved

Crystal Reports--fixed field lengths for output

Posted on 2009-07-16
6
743 Views
Last Modified: 2013-11-15
I need to create a crystal report which will also be used for Export to an Excel file.  For the Excel file, it is required that each field be a specific length (see the attached template).  Is there a way in Crystal to set lengths of each field?
Your help is appreciated.
Thanks
IFAS-template.xls
0
Comment
Question by:mbroad02
6 Comments
 
LVL 11

Accepted Solution

by:
aelliso3 earned 350 total points
ID: 24873953
If you need a field that is always exactly 30 characters, you can use something like:

 Left ({table.field} + Space (30), 30)

 For different fields and lengths, just replace the field name and the two 30's with appropriate values
0
 
LVL 34

Assisted Solution

by:James0628
James0628 earned 100 total points
ID: 24875653
aelliso3's suggestion would probably be the first thing I'd try.  If all of your fields are strings, then create a formula like the one he posted for each field and put those formulas on the report.

 If some of your fields are numeric and you need a specific field length on those too, that might be trickier.  You can convert the numbers to strings, which will let you format them however you want (eg. with leading spaces or 0's), but will it be a problem if the numbers are converted to strings before they're exported to the Excel file?

 James
0
 

Author Comment

by:mbroad02
ID: 24878196
That works just fine--thank you.  But if I can get a bonus question answered in this:
I also need to remove the first 2 characters of the field I am formatting before I print it.  I create a field called INVOICE_NO, removing dashes from the CASE.DSCR and formatting the date (appended to the CASE.DSCR.
Then I limit the INVOICE  field to 16 characters.
BUT, before I print, I need to remove the first two characters (leftmost).


Example formula code:
stringVar INVOICE_NO :=  Replace({REAL_CASE.DSCR},'-','') & "-" & Totext({APPTPMT.PMT_DT},"MM/dd/yy");
stringVar PRINT_INVOICE := Left({@INVOICE} + Space (16), 16);
PRINT_INVOICE;

If you can assist--I truly appreciate it.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 50 total points
ID: 24879095
Use

Mid({YourField},3)

mlmcc
0
 

Author Closing Comment

by:mbroad02
ID: 31604377
Thank you for all of your help!!
0
 
LVL 34

Expert Comment

by:James0628
ID: 24883979
You're welcome.  Glad I could help.

 James
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now