Start Event (LL_DRILLDOWN_START)

If this event is fired, you can create a thread and pass on the drilldown parameters. If your development systems does not support threads, you should use the main thread for the print job. In this case your program will not be usable for this period.

The return value of the callback (resp. the _lReply member of the scLlCallback-structure) should be set to a unique number, so you can assign the drilldown reports to the corresponding thread.

Example:


LRESULT        lResult = 0;
case LL_DRILLDOWN_START:
{
       scLlDrillDownJob* pDDJob = (scLlDrillDownJob*)lParam;
       … StartSubreport(pDDJob); …
       // generate new Drilldown-JobID
       lResult = ++m_nUniqueDrillDownJobID;
}
case LL_DRILLDOWN_FINALIZE:
{
       scLlDrillDownJob* pDDJob = (scLlDrillDownJob*)lParam;
       if (pDDJob->_nID == 0)
       {
                // clean up
       }
       else
       {
                // clean up the corresponding job
       }
}

return (lResult);
}

After copying the parameters, this thread creates a new List & Label job that uses the regular print loop. The following differences have to be made before calling LlPrintStart():

      set the option LL_OPTIONSTR_PREVIEWFILENAME to the path, that has been passed in the structure with _pszPreviewFileName

Example:

// set preview filename
::LlSetOptionString(pMyDrillDownParameters->m_hLlJob,
                LL_OPTIONSTR_PREVIEWFILENAME,
                pMyDrillDownParameters ->m_sPreviewFileName);

      Pass on the _hAttachInfo to List & Label that has been passed with the callback structure, so the print job is informed whrere the data should be displayed.

Example:

// attach viewer
::LlAssociatePreviewControl(pMyDrillDownParameters->m_hLlJob,
                 (HWND)pMyDrillDownParameters->_hAttachInfo,
                LL_ASSOCIATEPREVIEWCONTROLFLAG_DELETE_ON_CLOSE |
                LL_ASSOCIATEPREVIEWCONTROLFLAG_HANDLE_IS_ATTACHINFO);