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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

export multiline address field from crystal to excel

Status
Not open for further replies.

s_reddibathuni

Programmer
Jul 18, 2023
1
US
I have a multiline address field in crystal reports header section. After I export the report to excel the complete multiline address field should fit in a single row. Could someone help me?
 
Hi,

Welcome to Tek-Tips.

We need more information. I don't know if your problem is in Crystal Reports or in Excel.

If Excel is where the transposition "should fit in a single row" then this thread ought to be posted in Forum68.

How many rows are in the "multiline address field in crystal reports header section"?

Is that number of rows the same for every header every time? For instance might it always be...

Name
Street address
City, State Zip

...3 header rows transposed to 1 Excel row...

But then the question remains, how many columns? 1, 3, 5?

Could the header address SOMETIMES be 4 rows or 2 rows?

Inquiring minds want to know.

BTW, reports are TERRIBLE sources for data analysis, generally speaking. I almost always start looking for source data, but I know that not always possible.

BTW2, an EXAMPLE would be very helpful.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

You Matter...
unless you multiply yourself by the speed of light squared, then...
You Energy!
 
Assuming you have the following as columns:

CompanyName, Address, Address2, City, State, Zip

Put them in the details section. CompanyName should have zero space to the left and Zip should be stretched out all to the right. Then suppress every single section except the details section. Export to excel using the data only option.

Macola Software and SAP Business One Consultant

Check out our Macola tools:
 
Another option would be to create a formula that will display the address, taking into account that Address2 may or may not have data. Something like this:

Code:
Local StringVar newLine := chr(13) + chr(10);  //Carriage return/Line feed = Windows "New Line".
Local StringVar result := {table.CompanyName} + newLine + {table.Address1} + newLine;
if not IsNull({table.Address2}) then
  result := result + {table.Address2} + newLine;
result := result + {table.City} + ', ' +{table.State} + ' ' + {table.ZipCode};
result

This will give you a multi-line address in the report that will be in a single, word-wrapped cell in Excel.

-Dell

Associate Director, Data & Analytics
Protiviti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top