transfer data from subreport to mainreport

Posted on 2009-12-18
Last Modified: 2012-05-08

i'm working with CR 8.5 and VB6.

I made up a Report with a subreport.
In the subreport i built an variable like this:

shared stringvar strFirstValue := cstr({dao.startzeit});

The formula is placed in the header section(either group or page header)  to get the first dataset from the detail Section.

I transfer this variable to the main report like this:

shared stringvar strFirstvalue;


Everything is working fine, when i put the formula in the footer sections of the main report.

Unfortunately i have to use this value in the page header section. There i get always an empty string.

How do i assign this variable to work in the Page header of the main report?

Thanks in advance

Question by:huey60
    LVL 77

    Accepted Solution

    You cannot use the result of value from a subreport at an earlier point in the main report - the subreport must run first before any data from it can be used in the main report.

    If you want a visible output from your subreport below the page header, then, in principle,  you need to create another version of your subreport that can be placed in the page header (and produce no visible output but set the shared variables as required) above the point you want to display the result.

    However, without knowing more about the structure and main-subreport links I can't say for sure whether you can achieve that. And of course page headers only get created if there is something to put on the page.

    Author Closing Comment

    thanks, i thought so, but wasn't sure

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now