Solved

Crystal Reports--fixed field lengths for output

Posted on 2009-07-16
6
753 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 35

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 35

Expert Comment

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

 James
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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