Avatar of mbroad02
mbroad02Flag for United States of America

asked on 

How to transfer data from sub-report to main-report

I am sort of a novice in Crystal reports.

I am creating a main report with a subreport.  I know how to link the report and subreport together so correct data is displayed.  however, for exporting purposes, I would like to transfer each record's data from the sub-report to the main report and display there.

Any "for dummies" instructions are appreciated :)
Thanks
DB Reporting ToolsCrystal Reports

Avatar of undefined
Last Comment
mbroad02
Avatar of frodoman
frodoman
Flag of United States of America image

>>> I would like to transfer each record's data from the sub-report to the main report and display there.

You can't reasonably transfer the data, but the subreport will show up within the main report during export if it is normally visible (in other words you don't have it as an on-demand subreport or have it suppressed, etc.).

You can use shared variables to pass values between main/sub reports but it isn't normally practical or desireable to pass entire subreport fields.  Also you're limited to the variable types that are native to Crystal.

Perhaps if you can describe more completely what you want to happen then we could make a more specific recommendation?

frodoman
Avatar of mbroad02
mbroad02
Flag of United States of America image

ASKER

Please see the attached The subreport data displays when I run the main report, but  will not export if I try to export all of the data to a CSV file.   How can I get all of the data to export?
Thanks
report.doc
Avatar of Mike McCracken
Mike McCracken

Is there a way you can join the subreport SQL to the main report SQL?

mlmcc
Avatar of mbroad02
mbroad02
Flag of United States of America image

ASKER

I'm not sure what you are asking.  the subreport IS joined to the main report and is working.  I do not know how to join the SQL...
Can you create a single SQL that will return all the records and therefore you don't need the subreport?

mlmcc
Avatar of mbroad02
mbroad02
Flag of United States of America image

ASKER

Believe me, I have tried to create this in SQL without crystal, but the query is so complicated that I do not know how to sub-query the "subreport" query.  Any help would be appreciated.
Avatar of mbroad02
mbroad02
Flag of United States of America image

ASKER

I understand that it may be more efficient in SQL, but I have no idea how to do this.  I have the Crystal report working, but I just need to know how to move all of the data from the subreport to the main report for exporting.  if you can help with this, I truly appreciate it.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of mbroad02
mbroad02
Flag of United States of America image

ASKER

The subreport is a regular subreport and works one record at a time.  
What about this?
1-run the main report and export that data to a flat file
2-read in that flat file data to an SQL query which does what the subreport does?

I do not know if SQL can read in a flat file.  Would you know how to do this?
Avatar of mbroad02
mbroad02
Flag of United States of America image

ASKER

Just for comparison sake, how DO you go about creating shared variables and moving the subreport data to the main report?
Avatar of mbroad02
mbroad02
Flag of United States of America image

ASKER

I am sorry, but I am rushed to get this working.  I looked on the internet regarding shared variables and moving data from a subreport to a main.  I think I have it.

Thanks
Avatar of mbroad02
mbroad02
Flag of United States of America image

ASKER

The expert attempted to help but I could not wait for a more detailed answer (I listed it as 500 points because it was urgent).  I researched the answer on other tech sites and was able to solve myself.
thank you
Crystal Reports
Crystal Reports

Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.

36K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo