Hi Susanne,
Are you setting the parameter to the subreports? I mean. are you getting the subreport from the main report, opening the subreport. Then accessing the IParameterDefinition object and setting the values to it?
From the main Report object, you have to get a handle to each of the subreports, open the report, set the parameters, Open the database connection then set the location. Hope this helps. Let me know.
Here is the code
HRESULT CMyClass:

rocessSubReports(_variant_t varDataSource, CRYSTALCRAXDRT::IReportPtr& spReport,_bstr_t bstrServer, _bstr_t bstrDatabase,_bstr_t bstrUserID, bstr_t bstrPassword)
{
HRESULT hr = S_FALSE;
// Find out if there are subreports.
// object declarations
ISectionsPtr pSections = NULL;
ISectionPtr pSection = NULL;
IReportObjectsPtr pRepObjects = NULL;
IReportObjectPtr pRepObject = NULL;
ISubreportObjectPtr pSubObject = NULL;
IReportPtr pSubreport;
// get the number of sections in the report
pSections = spReport->GetSections();
//long count = 0;
// loop through each section in the report
for (long i = 1;i <= pSections->GetCount();i++)
{
// Create a variant to hold the value of i
VARIANT var2;
VariantInit(&var2);
var2.vt = VT_I2;
var2.lVal = i;
// pass the value of i to get the i-th section
pSection = pSections->GetItem(var2);
// get the report objects collection from the section
pRepObjects = pSection->GetReportObjects();
// as long as there are report object....
if (!pRepObjects->GetCount() == 0)
{
// ... loop through each
for (long j = 1;j <= pRepObjects->GetCount(); j++)
{
// Create a variant to hold the value of j
VARIANT var;
VariantInit(&var);
var.vt = VT_I4;
var.lVal = j;
// pass the value of j to the the j-th report object
pRepObject = pRepObjects->GetItem(var);
// if the report object is a subreport
if (pRepObject->GetKind() == crSubreportObject)
{
// re-assign the report object as a subreport object
pSubObject = pRepObject;
// to work with the subreport....
pSubreport = pSubObject->OpenSubreport();
CRYSTALCRAXDRT::IParameterFieldDefinitionsPtr pParameters = pReport->ParameterFields;
//: walk all of the crystal parameters in the report
long lCount = pParameters->GetCount();
CString sParamName;
CString sParamValue;
for(int i=1; i<=lCount; i++)
{
CRYSTALCRAXDRT::IParameterFieldDefinitionPtr pParameter = pParameters->GetItem(i);
sParamName = pParameter->GetParameterFieldName();
if ( sName.CompareNoCase( csParamName ) == 0 )
{
//: set the value for crystal
if ( SetCrystalParameterForCrystal
)
{
//: move on to the next
break;
}
}
}
CRYSTALCRAXDRT::IDatabasePtr spDB = pSubreport->GetDatabase();
hr = spDB->Tables->GetItem(_variant_t ((long)1))->SetLogOnInfo(bstrServer, bstrDatabase,bstrUserID,bstrPassword);
if(FAILED(hr))
return hr;
spDB->Tables->GetItem(_variant_t ((long)1))->Location = varDataSource.bstrVal
}
}
}
}
return hr;
}