cancel
Showing results for 
Search instead for 
Did you mean: 

Get values from another report document

Former Member
0 Kudos

Hi all,

I had a report that performs many calculations while loading.

It's simple to perform the calculation on the report rather doing it with code.

Now i wanted to use the some results in another crystal report document for further calculation. Can I achieve that?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Nebil,

You cannot share values from another report that is 'outside' the existing report. You can only share values between a Main Report and a Subreport.

You can insert the other report as a Subreport and use 'shared variables' to pass back values to the Main Report or vice-versa.

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

I made three different reports, with one having a sub reports (the report you saw on the grouping problem question).

Then I made another one for holding these three reports and linked them with a project id,since it's a project specific.But it doesn't display the sub-reports in the first report I made.

Am I missing something?

ido_millet
Active Contributor
0 Kudos

Crystal reports supports only one level of subreports. A subreport can't contain a subreport.

Former Member
0 Kudos

Would it be possible if I place the other 2 reports inside the group footer of the report which has the sub reports inside it?

They depend on the values returned from this report for further calculation. Any thoughts on that?

Thank you!

Former Member
0 Kudos

Is it possible to write the results to a table in the database?

Answers (2)

Answers (2)

ido_millet
Active Contributor
0 Kudos

You can create/use a User Function Library (see list of 3rd-party UFL's at http://kenhamady.com/bookmarks.html) to write/read values to/from text file, ini file, or the registry.

You can export the report data to a file for use as a data source by another report. If performance/automation is important, one of the 3rd-party desktop crystal reports schedulers listed at http://kenhamady.com/bookmarks.html can export to ODBC and replace (or append to) the data in an existing table.

If this is something you do infrequently you can simply manually delete the table, export to it via ODBC (in Crystal) using the 1st report, and use the table in the 2nd report.

Former Member
0 Kudos

Hi Nebil,

If the data to passed from one report to the other is not much, you can try using Memory Variables to pass it on.

For that, you need to SET the memory variable in called report and GET the memory variable in the calling program.

You may try using this approach.

Thanks,

Gayatri

Former Member
0 Kudos

Can you give me an example on that?

And one question is that doesn't it be destroyed when the report unloads?

Former Member
0 Kudos

Hi Nebil,

Here is the link for the example:

Sample ABAP Program to EXPORT or IMPORT internal table TO or FROM ABAP Memory - ABAP Development - S...

The contents of ABAP memory are retained, even across several levels i.e. even after the report unloads. The data will be there till it is overwritten the next time using EXPORT ... TO MEMORY


The called transaction can then retrieve the data from there using IMPORT ... FROM MEMORY


Here is the SAP Help link to give more information on its usage

https://help.sap.com/saphelp_45b/helpdata/en/34/8e73a36df74873e10000009b38f9b8/content.htm

Hope it helps!

Thanks,

Gayatri

DellSC
Active Contributor
0 Kudos

While this may work in ABAP, it does NOT work inside of Crystal.  Also, most Crystal users are NOT connecting to SAP data sources.

-Dell