Página 1 de 1

Problems with OwnPreview

Publicado: Lun Feb 26, 2024 4:58 pm
por bingen
Hi Xailer Team.

There is a problem with a FR inside a owner preview, you can test it with Samples\FastReport\OwnPreview.xpj

All goes ok if you print once, if you try twice nothing goes, no print and no error.

:shock:

Re: Problems with OwnPreview

Publicado: Mar Feb 27, 2024 11:28 am
por ignacio
Hi,

Not able to reproduce you error. Please indicate the exact operations to reproduce your error on sample \FastReport\OwnPreview. TIA.

Regards,

Re: Problems with OwnPreview

Publicado: Jue Feb 29, 2024 1:04 pm
por bingen
It's easy

Open the project Samples\FastReport\OwnPreview.xpj and run, make click over [Print] button and print the document on paper or to a Pdf printer, all goes OK.

Now, try to print a second copy... [Print] do not run.

Thanks

Re: Problems with OwnPreview

Publicado: Jue Feb 29, 2024 5:38 pm
por ignacio
Not so easy. I'm a afraid. :-(

Just push the Show button before pushing the Print button again. If you have to blame someone, blame on Fast-Repport.

Regards,

Re: Problems with OwnPreview

Publicado: Mar Mar 05, 2024 11:10 am
por bingen
Ok "solved"

If someone wants to print twice, before print a new copy I send a fr:Show(), ugly but effective.

But, in FR's original preview works well.

Re: Problems with OwnPreview

Publicado: Mié Mar 06, 2024 6:14 pm
por ignacio
Hi,

Our code is strictly a call to the FR print method and we do not anything else. So, is not our fault. I guess FR recreates the report if has been already printed. That's all.

Regards,

Código: Seleccionar todo

XA_FUNC( XFASTREPORT_PRINTC )
{
   static Print pFunction = NULL;
   PHB_ITEM Self = hb_stackSelfItem();
   BOOL lSuccess = FALSE;
   long pObject = XA_ObjGetNL( Self, "pObject" );

   if( pObject )
   {
      if( !pFunction )
         pFunction = (Print) GetProcAddress( hLib, "Print" );

      if( pFunction )
         lSuccess = ( pFunction )( pObject );
      else
         SetError( 125, "Exported function Print() not found in DLL" );
   }

   hb_retl( lSuccess );
}