Dynamically changing TfrDBDataSet's dataset proper
OK, I have a multi-purpose routine that accepts a passed in Dataset and I need to create a report from this dataset. What order should I do things? I've tried this:
frDBDataSet->DataSet = pDS;
frDBDataSet->Init();
if ( LoadReport( sReportName, frReport ))
{
frDBDataSet->RangeBegin = (bCurRow) ? rbCurrent : rbFirst;
frDBDataSet->RangeEnd = (bCurRow) ? reCurrent : reLast;
frDBDataSet->OpenDataSource = false; // tis already open
frReport->ShowPrintDialog = false;
frReport->ShowProgress = false;
if ( frReport->PrepareReport() )
bRet = ExportToStream( frReport, pMemStr, cFormat );
}
but when OnGetValue is called, the dataset doesn't appear to point to a valid record - probably at EOF ???
Anyone?
TIA
frDBDataSet->DataSet = pDS;
frDBDataSet->Init();
if ( LoadReport( sReportName, frReport ))
{
frDBDataSet->RangeBegin = (bCurRow) ? rbCurrent : rbFirst;
frDBDataSet->RangeEnd = (bCurRow) ? reCurrent : reLast;
frDBDataSet->OpenDataSource = false; // tis already open
frReport->ShowPrintDialog = false;
frReport->ShowProgress = false;
if ( frReport->PrepareReport() )
bRet = ExportToStream( frReport, pMemStr, cFormat );
}
but when OnGetValue is called, the dataset doesn't appear to point to a valid record - probably at EOF ???
Anyone?
TIA