Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Exporting to Excel when using Subreport Issue Post Reply Post New Topic
Author Message
Treadgold
Newbie
Newbie
Avatar

Joined: 10 Dec 2010
Location: Netherlands
Online Status: Offline
Posts: 1
Quote Treadgold Replybullet Topic: Exporting to Excel when using Subreport Issue
    Posted: 10 Dec 2010 at 4:22am
Hi there,
 
I am a database Admin for a major corporation, and we use crystal reports extensively.
 
I have one annoying issue, which for the life of me, I cannot solve, or my colleagues for that matter also...
 
I am using Crystal V 8.5.975 and I don't have the option to upgrade to a new version.
 
I have made a report to obtain some customer record data and data from a cost table, which contains a historical record of costs for certain products.
 
The way that the cost table is arranged, I have to end up using a subreport. My report is organized something similar to this:-
 
Customer Repair ID, Repair Date, Product ID, <Subreport: Product ID, Cost Date, Cost of Product>
 
Cost date contains the list of dates when the cost of the product changed price, and Cost of Product is the cost of that product on that day.
 
Repair Date and Product ID are linked to the the Product ID and Cost Date fields in the subreport by passing the parameter field or shared variable into the subreport.
 
I have made the report, it is fully working in Crystal, which is great, however, here's the problem:
 
 
When I export to Excel 8.0, all fields are displayed, except the cost field in the sub report. However, when I export to .pdf file, all fields are displayed correctly. It's just whenever I export to excel, it misses off this field.
 
The main purpose of this is to export to excel.
 
So, has anyone encountered this problem before when exporting to excel when using a sub report?
 
I have tried:
 
- Resizing all columns to the the same size
- Aligned all lefts/rights vice versa
 
Due to the way the table structure is arranged, I have to use a subreport here.
 
Any clues?
 
regards
 
Treadgold
 
 
 
IP IP Logged
Hviezdoslav
Newbie
Newbie


Joined: 19 Jul 2010
Location: United States
Online Status: Offline
Posts: 9
Quote Hviezdoslav Replybullet Posted: 21 Feb 2011 at 9:24am
Hi Treadgold,
 
I am not very experienced in Crystal Reports, so please pardon me if my reply is way off base or makes no sense.
 
I have a Crystal Report that I created and in it there is a sub report that I created.  The sub report is within the one Crystal Report that has the main report in the Details section and that has the sub report in the Report Footer.  When I export to Excel the results of this Crystal Report, I do not have your problem but the two columns in my main report are named the same and are in the same order as the two columns in my sub report and the data type of each column is the same in the sub report and main report.
 
I am guessing that the data type of Cost of Product of the sub report is different than the data type of the Product ID of the main report.
 
So I am thinking that Excel for its third column is having trouble because the main report's Product ID is a different data type than the sub report's Cost of Product.  Maybe after exporting to Excel, the Excel software shows the third column's Product IDs that come from the main report but does not show in the third column the values for Cost of Product from the sub report because Excel has determined already that its third column is an initeger/number data type within Excel since that is the data type of the main report's third column.
 
The main report's first column Repair ID and the sub report's first column Product ID are within Excel the same data type.
 
The main report's second column Repair Date and the sub report's second column Cost Date are within Excel the same data type.
 
I am wondering if within Excel though that the Excel software is having problems with the column that has an Integer/Number presumably as the data type for the main report's Product ID and that has Currency presumably as the data type for the sub report's corresponding Cost of Product.
 
If this is the case, and I am not certain that it is the case, I do not know for sure how to solve it.  Maybe in the main report and sub report, you could have the same columns with something like the following:
 
Repair ID/Repair Date/Product ID/Cost Date/Cost of Product
 
In the main report, you would have some dummy columns that would show as empty in the Crystal Report since the main report has only the real data fields Repair ID, Repair Date, and Product ID.  In the sub report as shown in the Crystal Report, you would have some dummy columns with no values shown since the sub report has only the real data fields Product ID, Cost Date, and Cost of Product. 
 
Then maybe all rows of the main rpt and sub rpt will export into the Excel file, and maybe each row in the main report will have nothing in its dummy/fake columns of the XLS file and maybe each row of the sub report will have nothing in its dummy/fake columns of the XLS file.  So after exporting to Excel, the XLS file would have 6 columns; and each row will have no value in its dummy/fake columns.
 
I am probably not making any sense.  I just noticed that the Cost of Product of the sub report as shown or as would be shown in the Excel file is under the rows of the XLS file that are from the main report in the XLS file's third column named Product ID.  I am wondering if Excel just has a problem with that column since it first brings into it from the main report the Product ID values and then will not accept in that column the ensuing currency values from the sub report's Cost of Product.
 
Sorry if this reply is a complete waste of your time!
 
Hviezdoslav
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.