Solved

Crystal Reports--fixed field lengths for output

Posted on 2009-07-16
6
746 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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Select Cross-tab total 2 62
Multiple Parameters in Crystal 11 77
Pull date to Group header 6 30
Subreport with Multiple Declared Shared Variables in 1 Formula 2 5
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
How to increase the row limit in Jasper Server.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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