Run a UBE from an Application

David Tobbe

Member
Version XE and 8.10

Is there a way to run a batch application from an interactive application with passing a data structure and skipping the "Printer Selection Before Print" screen?

If I just have a UBE report interconnect, it always calls the "Printer selection before print" screen I don't want it to call this screen, but I still want to pass a data structure.

Thanks
 
Make a NER that calls the UBE instead of invoking the report from the App. This will skip the 'printer' screen.
 
We found that a business function will work, but there were limitations in an NER. There was a problem with the Queue it would run in and not being able to default in Print Immediate. We wrote a C function that relieved these issues.
You need to review code that manipulate the PUBEVAR data type. Also you'll need to include the structure of the report in the header file so that you can load it and pass it to the jdeLaunchUBEEx API:

jdeLaunchUBEEx((HUSER)hUser, (PUBEVAR)pUbeVar, (LPVOID)&dsRxxxxxx,
lpBhvrCom);

Some key points are:
PUBEVAR pUbeVar = (PUBEVAR)NULL;

pUbeVar = jdeAlloc(COMMON_POOL, sizeof(struct tagUBEVAR),MEM_ZEROINIT);
if (pUbeVar != (PUBEVAR)NULL)
{
memset((void *)pUbeVar, (int)'\0', sizeof(pUbeVar));

/*--------------------------------------------------------------------
* Load Ube Structure
*-------------------------------------------------------------------*/
pUbeVar->bPreview = FALSE;
jdeNIDcpy((char *)pUbeVar->szReport,(const char *)"R5642565");

strcpy((char *)pUbeVar->szVersion, (const char *)lpDS->szVersion);

strcpy((char *)pUbeVar->szMachineKey, (const char *)lpDS->szComputerID);
GetLocalEnvironmentName(pUbeVar->szEnhv, 11);
pUbeVar->idRunTime = (GLRTID)lpBhvrCom->hDlg << 16;

/*--------------------------------------------------------------------
* Run the UBE Asynchronously
*-------------------------------------------------------------------*/
pUbeVar->bSynchFlag = TRUE;

/*--------------------------------------------------------------------
* Run the UBE in Batch Mode
*-------------------------------------------------------------------*/
strcpy((char *)pUbeVar->szJobQueue, (const char *)"FGOUT1");
pUbeVar->bBatchFlag = TRUE;
pUbeVar->zReportFlags |= eDRRPTPrintImmediate;
pUbeVar->zReportFlags |= eDRRPTSaveOutput;
.
.
.

Do a global search on a few of these terms such as PUBEVAR and you will find standard functions that will help you.
 
At 8.10, depending on your TR, you can specify Print Immediate when you create your versions. So if you don't care which queue it runs in you can use NER.

Barry
 
Back
Top