jdeLaunchUBEEx: Suppress both print & preview for local runs.

kand

Member
Hello, everybody.

I use the self-made command-line non-interactive launcher to run UBE.
If a job is submitted to an application server, no troubles. But, if a job submitted *locally*, JDE either *prints* it, or launches Acrobat to display PDF.

But sometimes I want to run UBE *locally*, but unattendantly, for example, on fat client on Windows terminal server, from some script. In this scenario, nobody can see the Acrobats hidden somewhere deeply in the Windows server.

*** How can I force jdeLaunchUBEEx neither launch Acrobat nor print report ?
I just need PDF files left in a local PrintQueue.
 
Sometime you'll not be promped to see pdf, but see at C:\B7\PrintQueue.

Hope that will help
 
</font><blockquote><font class="small">Â îòâåò íà:</font><hr />
Sometime you'll not be promped to see pdf, but see at C:\B7\PrintQueue.

[/ QUOTE ] Really, I'll not be prompted to do something, but this happens not "sometime", this happens if I set ubevar.bBatchFlag to TRUE. But: I want not to "see" pdf, rather than not to "be prompted" to see pdf.
</font><blockquote><font class="small">Â îòâåò íà:</font><hr />
Hope that will help

[/ QUOTE ] That will not help, this answer is not for my question.
 
Konstantin,

here are the settings I use for a similar use:

/************************************************************************
* Main Processing
************************************************************************/
/* Initialize Local Variables and Data Structures. */
jdeStrcpy (lpDS->szErrorMessageID,_J(" "));

/* load ube variables */

jdeNIDcpy(dsUbeStructure.szReport,lpDS->szProgramId);
jdeNIDcpy(dsUbeStructure.szVersion,lpDS->szVersion);

if(lpDS->cPrintFlag == _J('1'))
{
dsUbeStructure.bPreview = TRUE; /* preview on */
}
else
{
dsUbeStructure.bPreview = FALSE; /* for print, default is no preview */
}

if(lpDS->cPrintFlag == _J('2')) /* Print Immediate */
{
dsUbeStructure.zReportFlags = eDRRPTSaveOutput | eDRRPTPrintImmediate;
}

if(lpDS->cPrinterPrompt == _J('1'))
{
dsUbeStructure.bBatchFlag = FALSE; /* prompt for printer location */
}
else
{
dsUbeStructure.bBatchFlag = TRUE; /* no prompt for printer location */
}

if(lpDS->cAsynchSynch == _J('1'))
{
dsUbeStructure.bSynchFlag = FALSE; /* run UBE as independent job */
}
else
{
dsUbeStructure.bSynchFlag = TRUE; /* run UBE as dependent job */
}

dsUbeStructure.idRunTime = 0;
jdeGetHostName(dsUbeStructure.szMachineKey,DIM(dsUbeStructure.szMachineKey),0);
GetLocalEnvironmentName(dsUbeStructure.szEnhv,sizeof(dsUbeStructure.szEnhv));

if(lpDS->cRunLocal_OverrideOCM == _J('1'))
{
jdeStrcpy(dsUbeStructure.szHostName, SC_LOCAL_SERVER);
}

idJDEDBReturn = jdeLaunchUBEEx(hUser, &dsUbeStructure, NULL, lpBhvrCom);
 
Thank you for answer, Larry.
Your code is almost exactly the same as mine. Let me pose the problem.

Let "dsUbeStructure.szHostName" IS BLANK. Then UBE will run locally.
IF dsUbeStructure.bPreview = TRUE then
. JDE will launch Acrobat to show PDF
ELSE
. JDE will print PDF immediately, not taking note of "dsUbeStructure.zReportFlags"

The trouble is: I do not want neither launch Acrobat, nor print pdf. I just want to leave PDF in a local print queue. How can I accomplish this?
 
OK, I think its time you share a little information about your versions and system configuration.
 
[ QUOTE ]
OK, I think its time you share a little information about your versions and system configuration.

[/ QUOTE ]
Sorry, I forgot to do it earlier
frown.gif

E1 8.10 on Win 2003 EE ENU/IBM DB2 8.1.6 EE
 
Konstantin,

don't know what to tell you. My code works fine.
You said our code is "almost identical" but your local host handling sounds different than the below:

dsUbeStructure.idRunTime = 0;
jdeGetHostName(dsUbeStructure.szMachineKey,DIM(dsUbeStructure.szMachineKey),0);
GetLocalEnvironmentName(dsUbeStructure.szEnhv,sizeof(dsUbeStructure.szEnhv));

if(lpDS->cRunLocal_OverrideOCM == _J('1'))
{
jdeStrcpy(dsUbeStructure.szHostName, SC_LOCAL_SERVER);
}
 
[ QUOTE ]
don't know what to tell you. My code works fine.

[/ QUOTE ]
What do you mean telling "works fine" ?
Is your code able to run the job locally and just leave the output a PrintQueue?
Without acrobat runs, and without printing?

[ QUOTE ]
You said our code is "almost identical" but your local host handling sounds different than the below:
<font class="small">Code:</font><hr /><pre>jdeStrcpy(dsUbeStructure.szHostName, SC_LOCAL_SERVER);</pre><hr />

[/ QUOTE ]
It doesn't matter. It's just another way to run the job locally. My OCM mapping points to "LOCAL", and the job runs local, if I leave ".szHostName" blank. Here is relevant portion of my code:
<font class="small">Code:</font><hr /><pre> LPBHVRCOM bfcom;
HUSER japp;
UBEVAR ubev;

// ...skip...

memset( &ubev, 0, sizeof(ubev));

jdeGetHostName( ubev.szMachineKey, DIM((ubev.szMachineKey)), 0);
ubev.bSynchFlag = modopt.sync ? TRUE : FALSE;
ubev.bBatchFlag = TRUE;


ubev .bPreview = modopt.doprint ? FALSE : TRUE;
if( modopt.doprint )
ubev .zReportFlags = eDRRPTPrintImmediate;


jd_strcpy( ubev.szReport, modopt.rptname );
jd_strcpy( ubev.szVersion, modopt.vername );
jd_strcpy( ubev.szJobQueue, modopt.jobqueue );

if( modopt.location )
jd_strcpy( ubev.szHostName, modopt.location );

jerr = jdeLaunchUBEEx( japp, &ubev, NULL, bfcom );

if ( JDEDB_PASSED != jerr )
{
apperr("jdeLaunchUBEEx failed.\n");
goto cleanup;
}</pre><hr />
 
Konstantin,

you asked: "Is your code able to run the job locally and just leave the output a PrintQueue? Without acrobat runs, and without printing?"

Answer is Yes.

I tested that just before my post.

Good Luck,
 
[ QUOTE ]
you asked: "Is your code able to run the job locally and just leave the output a PrintQueue? Without acrobat runs, and without printing?"

Answer is Yes.

I tested that just before my post.

[/ QUOTE ]
I'm sorry If I hurt you. It wasn't clear from your prior posts.

I'm giving up. It seems there is no way to get predictable results with JDE. Life too short to waste it programming for JDE.
 
Back
Top