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

Exporting subreports to excel 1

Status
Not open for further replies.

ianholmes

Programmer
Mar 24, 2001
61
GB
I have an existing report which displays cols A to G from an SP, and uses a SubReport to retrieve col H.
Cols I & J are then retrieved from the SP.
The output displays OK, but I now need to export to Excel.

When I select File > Export > Export Report > etc etc,
for each row on the report, I now get 3 rows :
row 1 contains cols A to G,
row 2 contains cols H, appearing in col A
row 3 contains col I & J, appearing OK in col I & J
This is repeated for all records.

I have tried umpteen different settings with SubReport Format, but cannot get all the columns in one row.

It is as if there are CR/LFs in front of, and after the subreport !


 
Silly question....is the subreport in the same section as the data in the main report?

Are you using the excel export "data only" option?

-- Jason
"It's Just Ones and Zeros
 
Hi Jason

Yes: all items are in the Details section.
I have zoomed to 200%, and there is nothing obvious either side of where the subreport is defined.

I select File > Export > Export Report
then Format - Microsoft Excel 97-2000 - Data Only (XLS)
Destination - Application
then defaults to Format > Custom, and the output is as I described earlier.

This rpt is actually being called by a .NET application,
but the results are exactly the same.
 
I don't see your custom options.

As a test....supress any and all headers (group, page, report,etc) and then choose export, excel, data only, custom, "column width based on objects in the details"


-- Jason
"It's Just Ones and Zeros
 
Thanks Jason
I use Crystal XI.
I don't get export > excel > data only > custom,
"column width based on objects in the details".

XI gives the path I sent in the last email.

 
There are some tricks to exporting with subreports which Ken Hamady has outlined. What works for me is to attach all fields and subs to gridlines (both vertical and horizontal), (and yes, it can be done with subreport objects, although the red corners don't appear). Also select each field/object/subreport in the section->format fields->make same size->height. Then resize the section to minimize the height of the section. I had the same problem with subreports wrapping and this fixed it.

-LB
 
Subreport wraps to next line when exporting to Excel:

I have tried every recommendation given by kenhamady and lbass (resizing and aligning fields, snap to grid, attach both left and right sides of fields and subs to gridlines, eliminate all space between fields, make the section as small as possible, etc) and contined to get the same results. This was using CR10 export to 'MS Excel 97-2000 (data only)'.

I finally got it to export on one line by changing the export type to 'MS Excel 97-2000' and selecting the option for 'Constant column width'.

Hope this helps someone. I've been at this for hours!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top