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!

Problem Exporting to Excel (data only)

Status
Not open for further replies.

UnknownProgrammer

Programmer
Feb 28, 2005
12
US
I have a subreport showing as additional fields in the records being printed in a report. The info in the subreport is financial data (multiple lines) per one record.

Example...

field1 field2 field3 subrptfld1 subrptfld2 subrptfld3
subrptfld1 subrptfld2 subrptfld3
subrptfld1 subrptfld2 subrptfld3

When I export the data to MS Excel as data only, all the subreport data wraps to the next line in the spreadsheet instead of extending across.

How can I stop the subreport info from wrapping? It does not do this in an export to PDF.

Thank you in advance for your help.
 
Hi,
Sometimes I find it helpful to have a report that is formatted expressly for exporting to Excel..I use a very wide page size and try to insure that all fields will be on 1 line only, per record.


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
In this case its not possible. subrptfld1, subrptfld2 & subrptfld3 are dollar amounts that are totalled for each record on the report.
 
If you need it for use by Excel, try using a comma delimited format, Excel will open it.

Data only implies a columnar table layout, and Crystal might have problems resolving this using subreports.

In general try to avoid subreports by using intelligent queries, such as advanced SQL Expressions or Views/SPs on the database.

When you don't mention the software being used, nor the database, it's hard to help you with advanced concepts.

-k
 
Sorry synapsevampire, I wasn't paying attention.

I am using Crystal reports advanced edition version 9.2.0.448 and extracting from MS SQL server 2000.

The report looks fine on the screen & exports to Adobe Acrobat just fine. It also exports to MS Excel fully formatted perfectly.

I need it to export to Excel as data only.

I tried to use an export to CSV as you suggested and it came out really weird. The column names were in the first 10 columns and then the data followed acress the file. The data from the sub report was nowhere to be seen.

Any ideas are appreciated.
 
Yeah, that's a formatting concern, the layout of your design doesn't match a data only export.

Think of the export as a table, and you'll quickly realize that the layout for display probably doesn't resemble the layout of a table.

I often create a parameter in a report which has a prompt for export in data format, andd then insert additional sections which are nothing more than a table layout, meaning a seperate report header for the headers, and a details section with the fields directly under those headings.

Then base the suppression formula for each based on the formula, for example the sections with the print/display formay would have:

{?Exportdata} = "Y"

The data sectiosn would have:

{?Exportdata} = "N"

-k
 
SV

I am working on something similar to this particular scenario. Could you post an example (or expound a bit further on the one above)? As this would help me greatly.

Sincerely,

AW



-- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top