Hi,
I am writing a report using Crystal version 10, I also have access to Crystal version 8.5.
The main report shows records based on the record accountant managers name.
There is also a sub report which exists to show which records from the main report have a second address.
The problem I am having is as follows:
Example, the accountant manager named Joe Bloggs has 10 records under his name, only 8 of these records have a second address as per the sub report. However when running the main and sub report together the report does not suppress the other two records i.e. only shows eight records it still shows 10 records. I assume the reason the report is still showing 10 records as opposed to just eight is because it is focusing on the main report selection criteria which is based on the accountant managers name.
I know this has something to do with shared variables which I have very little knowledge of, I have had a look on the internet and have attempted to write two formulas to get the main report to also consider the criteria of the sub report. These formulas are below, they do not work, please help if you can. Thanks
//@subformula
//Stores all contacts that have address in
//{CONTSUPP.CONTSUPREF}field
//in a string variable called 'AddressRecords'
whileprintingrecords;
shared stringvar AddressRecords := {CONTSUPP.CONTSUPREF}
//@mainformula
//Returns the records that are stored
//in the shared string variable called
//AddressRecords in teh subreport
Whileprintingrecords;
Shared Stringvar AddressRecords;
I am writing a report using Crystal version 10, I also have access to Crystal version 8.5.
The main report shows records based on the record accountant managers name.
There is also a sub report which exists to show which records from the main report have a second address.
The problem I am having is as follows:
Example, the accountant manager named Joe Bloggs has 10 records under his name, only 8 of these records have a second address as per the sub report. However when running the main and sub report together the report does not suppress the other two records i.e. only shows eight records it still shows 10 records. I assume the reason the report is still showing 10 records as opposed to just eight is because it is focusing on the main report selection criteria which is based on the accountant managers name.
I know this has something to do with shared variables which I have very little knowledge of, I have had a look on the internet and have attempted to write two formulas to get the main report to also consider the criteria of the sub report. These formulas are below, they do not work, please help if you can. Thanks
//@subformula
//Stores all contacts that have address in
//{CONTSUPP.CONTSUPREF}field
//in a string variable called 'AddressRecords'
whileprintingrecords;
shared stringvar AddressRecords := {CONTSUPP.CONTSUPREF}
//@mainformula
//Returns the records that are stored
//in the shared string variable called
//AddressRecords in teh subreport
Whileprintingrecords;
Shared Stringvar AddressRecords;