ananthap
May 4th, 1999, 11:20 PM
Dear Friends
Written a C program on Windows NT platform to access the Crystal Report Engine through
Crystal Report Engine API tools(crpe32.dll).
I am not able to successfull code a Print Link .
I am following the following steps specified by the crystal report manual
There are six required steps to coding a Custom-Print link in your application.
Each uses a different REAPI function. The steps are:
step 1. Open the Crystal Report Engine (PEOpenEngine).
step 2. Open a print job (PEOpenPrintJob).
step 3. Set the output destination (PEOutputToPrinter, PEOutputToWindow, or PEExportTo).
step 4. Start the print job (PEStartPrintJob).
step 5. Close the print job (PEClosePrintJob).
step 6. Close the Crystal Report Engine (PECloseEngine).
Code for Custom Print Link
=============================
int PrintReportDirect(short hJob,short NoOfCopies)
{
int bResult;
step 3 bResult = PEOutputToPrinter(hJob,NoOfCopies);
if ( bResult )
{
step 4***** bResult = PEStartPrintJob(hJob, TRUE); ***********
}
return bResult;
}
void main()
{
short ExecStatus,handle;
step 1 ExecStatus = OpenEngine();
step 2 handle = PEOpenPrintJob( "c:\\wisorgat\\reports\\enduser.rpt" );
if ( !handle )
{
ReportError(handle);
}
ExecStatus = PrintReportDirect(handle,1);
if( !ExecStatus )
{
printf("Error = %s \n", ReportError(handle));
}
step 5 ClosePrintJob(handle);
step 6 CloseEngine();
}
While debuuging the program I found that the the prgram executes fine till step no 3
but it fails at step 4 *****bResult = PEStartPrintJob(hJob, TRUE); ***********,
When i printed the Error message it says Low System resources and returns an error code 568.
I am working on Pentium m/c with 64 mB ram and 2gb Hardisk. I have no idea as why
it gives me this error. I kindly request if anyone could help me in this regard .
To fix this error. (I am able to show the report in the pre view window
, but not able to print it on the printer).
Could anayone please tell me where i am going wrong and mail me detail a soln to this
problem Tahnks in advance.
Always
Ananth Padmanabha P. H
IBC Solutions India Pvt Ltd.
Member Technical
#2201 11th Main A Block
Rajajinagar 2nd Stage
Bangalore -n 560 010
Phone : 91 - 80 - 3324313
91 - 80 - 3322139
91 - 80 -3321369
e-mail : ph_ananth@mailcity.com,ph_ananth@hotmail.com
ICQ Number : 23631229
Written a C program on Windows NT platform to access the Crystal Report Engine through
Crystal Report Engine API tools(crpe32.dll).
I am not able to successfull code a Print Link .
I am following the following steps specified by the crystal report manual
There are six required steps to coding a Custom-Print link in your application.
Each uses a different REAPI function. The steps are:
step 1. Open the Crystal Report Engine (PEOpenEngine).
step 2. Open a print job (PEOpenPrintJob).
step 3. Set the output destination (PEOutputToPrinter, PEOutputToWindow, or PEExportTo).
step 4. Start the print job (PEStartPrintJob).
step 5. Close the print job (PEClosePrintJob).
step 6. Close the Crystal Report Engine (PECloseEngine).
Code for Custom Print Link
=============================
int PrintReportDirect(short hJob,short NoOfCopies)
{
int bResult;
step 3 bResult = PEOutputToPrinter(hJob,NoOfCopies);
if ( bResult )
{
step 4***** bResult = PEStartPrintJob(hJob, TRUE); ***********
}
return bResult;
}
void main()
{
short ExecStatus,handle;
step 1 ExecStatus = OpenEngine();
step 2 handle = PEOpenPrintJob( "c:\\wisorgat\\reports\\enduser.rpt" );
if ( !handle )
{
ReportError(handle);
}
ExecStatus = PrintReportDirect(handle,1);
if( !ExecStatus )
{
printf("Error = %s \n", ReportError(handle));
}
step 5 ClosePrintJob(handle);
step 6 CloseEngine();
}
While debuuging the program I found that the the prgram executes fine till step no 3
but it fails at step 4 *****bResult = PEStartPrintJob(hJob, TRUE); ***********,
When i printed the Error message it says Low System resources and returns an error code 568.
I am working on Pentium m/c with 64 mB ram and 2gb Hardisk. I have no idea as why
it gives me this error. I kindly request if anyone could help me in this regard .
To fix this error. (I am able to show the report in the pre view window
, but not able to print it on the printer).
Could anayone please tell me where i am going wrong and mail me detail a soln to this
problem Tahnks in advance.
Always
Ananth Padmanabha P. H
IBC Solutions India Pvt Ltd.
Member Technical
#2201 11th Main A Block
Rajajinagar 2nd Stage
Bangalore -n 560 010
Phone : 91 - 80 - 3324313
91 - 80 - 3322139
91 - 80 -3321369
e-mail : ph_ananth@mailcity.com,ph_ananth@hotmail.com
ICQ Number : 23631229