Discussion:
DAX 2009: Printing a report with logo as PDF document in batch fai
(too old to reply)
nep
2009-01-22 15:46:01 UTC
Permalink
I wish to generate a PDF file on disk - I am using the standard Axapta PDF
engine which in this case is good enough.

For testpurpose I have changed the standard report 'CustBaseData' to include
the companylogo in the header. When prompted I select the print-medium
"File", an UNC path as file-name and the file-formata 'PDF'.

When I run this report from the client it works fine!

However when I submit it to batch the batchengine fails with this error:

The server-side impersonated (RunAs) session tried to invoke a method that
is available for client-side processing only.
(S)\Classes\PDFViewer\writeBitmap - line 47
(S)\Classes\ReportOutputUser\writeField
(S)\Classes\ReportOutputUser\printViaClass

If I remove the companylogo it works fine again.

The "funny thing" is that if I print e.g. a sales order confirmation with
the same setup it works fine printing the logo.

Is seems to me that the class PDFViewer has some issues handling things on
the AOS - maybe due to use of the WinAPI class. I have considering changing
this to use the WinAPIServer class - but that does not explain how (and why)
the sales form letter class works?!

I am puzzled - anyone got an idea?
--
Regards

nep
Dries
2009-05-06 07:22:07 UTC
Permalink
Hi Nep,

did you found a solution for this?
I happen to have the some issue.

Thanks for your reply!
Dries
Post by nep
I wish to generate a PDF file on disk - I am using the standard Axapta PDF
engine which in this case is good enough.
For testpurpose I have changed the standard report 'CustBaseData' to include
the companylogo in the header. When prompted I select the print-medium
"File", an UNC path as file-name and the file-formata 'PDF'.
When I run this report from the client it works fine!
The server-side impersonated (RunAs) session tried to invoke a method that
is available for client-side processing only.
(S)\Classes\PDFViewer\writeBitmap - line 47
(S)\Classes\ReportOutputUser\writeField
(S)\Classes\ReportOutputUser\printViaClass
If I remove the companylogo it works fine again.
The "funny thing" is that if I print e.g. a sales order confirmation with
the same setup it works fine printing the logo.
Is seems to me that the class PDFViewer has some issues handling things on
the AOS - maybe due to use of the WinAPI class. I have considering changing
this to use the WinAPIServer class - but that does not explain how (and why)
the sales form letter class works?!
I am puzzled - anyone got an idea?
--
Regards
nep
Bill Thompson
2009-05-06 14:33:32 UTC
Permalink
Hello,
This is actually a known issue. When you print a PDF with a bitmap on it
(for example, a company logo), it uses a kernel based class called Image.
In AX 2009, this class was changed the be Run on the CLIENT. It will not
run on the AOS. This means that any pdf printing that is batched in a
Server Based batch, cannot have a bitmap on it, or you will get the error
you are seeing. Any PDF files that contain graphics (bitmaps) that are
generated in batch will have to be run on a client side batch system.

I hope that this helps.....
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support

=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dries
Hi Nep,
did you found a solution for this?
I happen to have the some issue.
Thanks for your reply!
Dries
Post by nep
I wish to generate a PDF file on disk - I am using the standard Axapta PDF
engine which in this case is good enough.
For testpurpose I have changed the standard report 'CustBaseData' to include
the companylogo in the header. When prompted I select the print-medium
"File", an UNC path as file-name and the file-formata 'PDF'.
When I run this report from the client it works fine!
The server-side impersonated (RunAs) session tried to invoke a method that
is available for client-side processing only.
(S)\Classes\PDFViewer\writeBitmap - line 47
(S)\Classes\ReportOutputUser\writeField
(S)\Classes\ReportOutputUser\printViaClass
If I remove the companylogo it works fine again.
The "funny thing" is that if I print e.g. a sales order confirmation with
the same setup it works fine printing the logo.
Is seems to me that the class PDFViewer has some issues handling things on
the AOS - maybe due to use of the WinAPI class. I have considering changing
this to use the WinAPIServer class - but that does not explain how (and why)
the sales form letter class works?!
I am puzzled - anyone got an idea?
--
Regards
nep
Dries
2009-05-11 09:52:10 UTC
Permalink
Thanks for your reply...

ok, so i cannot use bitmaps (companylogo) on a PDF running on the batchserver.
Any idea for a workarround to include the logo ?

Appreciated !
Dries
Bill Thompson
2009-05-11 13:47:33 UTC
Permalink
Hello,
If you set up a client to run as a batch server (as our batch engine was
prior to AX 2009), you can do this. However, ANY PDF with graphics in it
(bitmaps) will not run as an AOS bound batch. This is why we recommend the
client based batch be run. There isn't any workaround using our PDF engine.
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support

=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dries
Thanks for your reply...
ok, so i cannot use bitmaps (companylogo) on a PDF running on the batchserver.
Any idea for a workarround to include the logo ?
Appreciated !
Dries
JMD
2009-07-22 02:13:01 UTC
Permalink
So What your saying is that if you setup a client to run a batch group (
Going to Basic -> Periodic -> Batch) and that Batch Group is setup (Admin ->
Setup -> Server Config -> Batch Server Group Selected), then it would be
possible to batch a PDF with an image?
Post by Bill Thompson
Hello,
If you set up a client to run as a batch server (as our batch engine was
prior to AX 2009), you can do this. However, ANY PDF with graphics in it
(bitmaps) will not run as an AOS bound batch. This is why we recommend the
client based batch be run. There isn't any workaround using our PDF engine.
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dries
Thanks for your reply...
ok, so i cannot use bitmaps (companylogo) on a PDF running on the batchserver.
Any idea for a workarround to include the logo ?
Appreciated !
Dries
Bill Thompson
2009-07-22 13:47:37 UTC
Permalink
Correct. The "old" way of batching (think version 3.0 and version 4.0) will
still allow you to print to PDF reports with images. ONLY the AOS batch
functionality has this issue.
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support

=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by JMD
So What your saying is that if you setup a client to run a batch group (
Going to Basic -> Periodic -> Batch) and that Batch Group is setup (Admin ->
Setup -> Server Config -> Batch Server Group Selected), then it would be
possible to batch a PDF with an image?
Post by Bill Thompson
Hello,
If you set up a client to run as a batch server (as our batch engine was
prior to AX 2009), you can do this. However, ANY PDF with graphics in it
(bitmaps) will not run as an AOS bound batch. This is why we recommend the
client based batch be run. There isn't any workaround using our PDF engine.
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dries
Thanks for your reply...
ok, so i cannot use bitmaps (companylogo) on a PDF running on the batchserver.
Any idea for a workarround to include the logo ?
Appreciated !
Dries
JMD
2009-07-22 15:58:01 UTC
Permalink
Thanks, it seems like I must be missing something.

It seems like even though the Batch Client is running that Batch Group, the
Server is trying to run the job. The Batch Task says its run location is
"server".

I am trying to batch email a Sales Order Confirmation. Batch client is
running Batch Group. It will send the confirmation in other formats, just
not PDF.

It seem like the Batch is trying to run on the server and not the client.
Post by Bill Thompson
Correct. The "old" way of batching (think version 3.0 and version 4.0) will
still allow you to print to PDF reports with images. ONLY the AOS batch
functionality has this issue.
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by JMD
So What your saying is that if you setup a client to run a batch group (
Going to Basic -> Periodic -> Batch) and that Batch Group is setup (Admin ->
Setup -> Server Config -> Batch Server Group Selected), then it would be
possible to batch a PDF with an image?
Post by Bill Thompson
Hello,
If you set up a client to run as a batch server (as our batch engine was
prior to AX 2009), you can do this. However, ANY PDF with graphics in it
(bitmaps) will not run as an AOS bound batch. This is why we recommend the
client based batch be run. There isn't any workaround using our PDF engine.
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dries
Thanks for your reply...
ok, so i cannot use bitmaps (companylogo) on a PDF running on the batchserver.
Any idea for a workarround to include the logo ?
Appreciated !
Dries
Bill Thompson
2009-07-24 13:44:41 UTC
Permalink
Hello,
If the batch process is calling a class, what is the RunOn property of the
class set to be? If it is set to server, the code is still running on the
AOS, which would cause this to occur. Try setting the runOn property to
Client. Also look in the objects being used and make sure that none of them
have the server keyword in the declarations, which again will force the code
to run on the AOS.

Remember that even though the object might be started on the client, it can
be pushed to run the business logic on the AOS, which also would cause this
issue to occur if it tries to generate the report on the AOS.

Hope this helps.....
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support

=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by JMD
Thanks, it seems like I must be missing something.
It seems like even though the Batch Client is running that Batch Group, the
Server is trying to run the job. The Batch Task says its run location is
"server".
I am trying to batch email a Sales Order Confirmation. Batch client is
running Batch Group. It will send the confirmation in other formats, just
not PDF.
It seem like the Batch is trying to run on the server and not the client.
Post by Bill Thompson
Correct. The "old" way of batching (think version 3.0 and version 4.0) will
still allow you to print to PDF reports with images. ONLY the AOS batch
functionality has this issue.
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by JMD
So What your saying is that if you setup a client to run a batch group (
Going to Basic -> Periodic -> Batch) and that Batch Group is setup (Admin ->
Setup -> Server Config -> Batch Server Group Selected), then it would be
possible to batch a PDF with an image?
Post by Bill Thompson
Hello,
If you set up a client to run as a batch server (as our batch engine was
prior to AX 2009), you can do this. However, ANY PDF with graphics in it
(bitmaps) will not run as an AOS bound batch. This is why we
recommend
the
client based batch be run. There isn't any workaround using our PDF engine.
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dries
Thanks for your reply...
ok, so i cannot use bitmaps (companylogo) on a PDF running on the batchserver.
Any idea for a workarround to include the logo ?
Appreciated !
Dries
unknown
2009-08-07 09:17:01 UTC
Permalink
Hi

I've had the same sort of problem, and solved it by calling a class that
calls my report. The class contains the following method:

public boolean runsImpersonated()
{
return false;
}

When the job is in the batch job, press the "View Task" button, and you can
see that the job is run on Client. The AOS will not execute the job, and it
will stay there until you start an "old-fasion".

It works for my issue :o)

Regards
Peter Ø
Post by Bill Thompson
Hello,
If the batch process is calling a class, what is the RunOn property of the
class set to be? If it is set to server, the code is still running on the
AOS, which would cause this to occur. Try setting the runOn property to
Client. Also look in the objects being used and make sure that none of them
have the server keyword in the declarations, which again will force the code
to run on the AOS.
Remember that even though the object might be started on the client, it can
be pushed to run the business logic on the AOS, which also would cause this
issue to occur if it tries to generate the report on the AOS.
Hope this helps.....
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by JMD
Thanks, it seems like I must be missing something.
It seems like even though the Batch Client is running that Batch Group, the
Server is trying to run the job. The Batch Task says its run location is
"server".
I am trying to batch email a Sales Order Confirmation. Batch client is
running Batch Group. It will send the confirmation in other formats, just
not PDF.
It seem like the Batch is trying to run on the server and not the client.
Post by Bill Thompson
Correct. The "old" way of batching (think version 3.0 and version 4.0) will
still allow you to print to PDF reports with images. ONLY the AOS batch
functionality has this issue.
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by JMD
So What your saying is that if you setup a client to run a batch group (
Going to Basic -> Periodic -> Batch) and that Batch Group is setup (Admin ->
Setup -> Server Config -> Batch Server Group Selected), then it would be
possible to batch a PDF with an image?
Post by Bill Thompson
Hello,
If you set up a client to run as a batch server (as our batch engine was
prior to AX 2009), you can do this. However, ANY PDF with graphics in it
(bitmaps) will not run as an AOS bound batch. This is why we
recommend
the
client based batch be run. There isn't any workaround using our PDF engine.
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dries
Thanks for your reply...
ok, so i cannot use bitmaps (companylogo) on a PDF running on the
batchserver.
Any idea for a workarround to include the logo ?
Appreciated !
Dries
Jonas
2009-08-14 09:50:01 UTC
Permalink
Hi Bill

Since you have identified this as "a known issue", does that mean that this
will be fixed in a later version? If so, has it been scheduled?

/Jonas Bergman
Post by Bill Thompson
Hello,
This is actually a known issue. When you print a PDF with a bitmap on it
(for example, a company logo), it uses a kernel based class called Image.
In AX 2009, this class was changed the be Run on the CLIENT. It will not
run on the AOS. This means that any pdf printing that is batched in a
Server Based batch, cannot have a bitmap on it, or you will get the error
you are seeing. Any PDF files that contain graphics (bitmaps) that are
generated in batch will have to be run on a client side batch system.
I hope that this helps.....
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dries
Hi Nep,
did you found a solution for this?
I happen to have the some issue.
Thanks for your reply!
Dries
Post by nep
I wish to generate a PDF file on disk - I am using the standard Axapta PDF
engine which in this case is good enough.
For testpurpose I have changed the standard report 'CustBaseData' to include
the companylogo in the header. When prompted I select the print-medium
"File", an UNC path as file-name and the file-formata 'PDF'.
When I run this report from the client it works fine!
The server-side impersonated (RunAs) session tried to invoke a method that
is available for client-side processing only.
(S)\Classes\PDFViewer\writeBitmap - line 47
(S)\Classes\ReportOutputUser\writeField
(S)\Classes\ReportOutputUser\printViaClass
If I remove the companylogo it works fine again.
The "funny thing" is that if I print e.g. a sales order confirmation with
the same setup it works fine printing the logo.
Is seems to me that the class PDFViewer has some issues handling things on
the AOS - maybe due to use of the WinAPI class. I have considering changing
this to use the WinAPIServer class - but that does not explain how (and why)
the sales form letter class works?!
I am puzzled - anyone got an idea?
--
Regards
nep
Andi
2010-09-28 07:05:03 UTC
Permalink
Hello Bill,

that's not an option to me. We've changed the purchase requisition workflow
to work completety unattended. It creates the purchase order and posts it
with printing to fax. This all works on the aos serverside via runas (from
the workflow engine). I cannot change that to client. Are there any other
opportunities?

Regards
Andi
Post by Bill Thompson
Hello,
This is actually a known issue. When you print a PDF with a bitmap on it
(for example, a company logo), it uses a kernel based class called Image.
In AX 2009, this class was changed the be Run on the CLIENT. It will not
run on the AOS. This means that any pdf printing that is batched in a
Server Based batch, cannot have a bitmap on it, or you will get the error
you are seeing. Any PDF files that contain graphics (bitmaps) that are
generated in batch will have to be run on a client side batch system.
I hope that this helps.....
--
Bill 'Luther' Thompson
Microsoft Online Support Engineer - MBS Dynamics AX Developer Support
=============================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dries
Hi Nep,
did you found a solution for this?
I happen to have the some issue.
Thanks for your reply!
Dries
Post by nep
I wish to generate a PDF file on disk - I am using the standard Axapta PDF
engine which in this case is good enough.
For testpurpose I have changed the standard report 'CustBaseData' to include
the companylogo in the header. When prompted I select the print-medium
"File", an UNC path as file-name and the file-formata 'PDF'.
When I run this report from the client it works fine!
The server-side impersonated (RunAs) session tried to invoke a method that
is available for client-side processing only.
(S)\Classes\PDFViewer\writeBitmap - line 47
(S)\Classes\ReportOutputUser\writeField
(S)\Classes\ReportOutputUser\printViaClass
If I remove the companylogo it works fine again.
The "funny thing" is that if I print e.g. a sales order confirmation with
the same setup it works fine printing the logo.
Is seems to me that the class PDFViewer has some issues handling things on
the AOS - maybe due to use of the WinAPI class. I have considering changing
this to use the WinAPIServer class - but that does not explain how (and why)
the sales form letter class works?!
I am puzzled - anyone got an idea?
--
Regards
nep
Bill Thompson
2010-10-04 18:45:51 UTC
Permalink
This post might be inappropriate. Click to display it.
Loading...