CITRIX Problem Error 2046 ReportToPDF

P

Peter Martin

I'm using Acc 03 on a Citrix farm and Mr. Lebans excellent ReportToPDF. With
the database window visible the PDF gets created fine: with it hidden it
fails with Error 2046

"The command or action '|' isn't available now.@* You may be in a read-only
database or an unconverted database from an earlier version of Maintenance
Schedules.
* The type of object the action applies to isn't currently selected or isn't
in the active view.@Use only those commands and macro actions that are
currently available for this database.@1@@1"

In other words, it looks exactly like:
BUG: Error Message 2046 Calling OpenForm or OpenReport with Access Automation
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q244695

except I'm not running Acc 2000 & I'm not using automation.

It fails in the modReportToPDF.ConvertToPDF function on the line
DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)",
strPathandFileName

I initially thought it was Citrix intercepting the GetTempPathA call (our
"application isolation level" is cranked to the max, I think, for whatever
reason).
On the desktop GetTempPathA returns C:\DOCUME~1\...\LOCALS~1\Temp\,
On Citrix it returns a unique path for each session: i.e. one session will
return X:\DOCUME~1\...\LOCALS~1\Temp\15\, another simultaneous session will
return X:\DOCUME~1\...\LOCALS~1\Temp\2e\ etc.
The folders are unique to that session and not even visible to other
sessions. Files created in X:\DOCUME~1\...\LOCALS~1\Temp are not visible in
other simultaneous sessions either.
However, I replaced the call to GetTempPath with CurrentDBDir() and it still
fails. (no problems with files here).

Can anyone schooled in the dark, riddled mysteries of Citrix help out please?

PS: Citrix Program Neighbourhood (v 9.200.44376)
 
M

maria-hominem

Ο "Peter Martin said:
I'm using Acc 03 on a Citrix farm and Mr. Lebans excellent ReportToPDF.
With
the database window visible the PDF gets created fine: with it hidden it
fails with Error 2046

"The command or action '|' isn't available now.@* You may be in a
read-only
database or an unconverted database from an earlier version of Maintenance
Schedules.
* The type of object the action applies to isn't currently selected or
isn't
in the active view.@Use only those commands and macro actions that are
currently available for this database.@1@@1"

In other words, it looks exactly like:
BUG: Error Message 2046 Calling OpenForm or OpenReport with Access
Automation
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q244695

except I'm not running Acc 2000 & I'm not using automation.

It fails in the modReportToPDF.ConvertToPDF function on the line
DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)",
strPathandFileName

I initially thought it was Citrix intercepting the GetTempPathA call (our
"application isolation level" is cranked to the max, I think, for whatever
reason).
On the desktop GetTempPathA returns C:\DOCUME~1\...\LOCALS~1\Temp\,
On Citrix it returns a unique path for each session: i.e. one session
will
return X:\DOCUME~1\...\LOCALS~1\Temp\15\, another simultaneous session
will
return X:\DOCUME~1\...\LOCALS~1\Temp\2e\ etc.
The folders are unique to that session and not even visible to other
sessions. Files created in X:\DOCUME~1\...\LOCALS~1\Temp are not visible
in
other simultaneous sessions either.
However, I replaced the call to GetTempPath with CurrentDBDir() and it
still
fails. (no problems with files here).

Can anyone schooled in the dark, riddled mysteries of Citrix help out
please?

PS: Citrix Program Neighbourhood (v 9.200.44376)
 
P

Peter Martin

FYI, the following worked: wrapped modReportToPDF.ConvertReportToPDF
OutputTo statement with call to display & minimize, then hide, the database
window.

modReportToPDF.ConvertReportToPDF
....
DoCmd.SelectObject acReport, , True 'required for Citrix
DoCmd.Minimize 'required for Citrix
DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)",
strPathandFileName
Application.RunCommand acCmdWindowHide 'required for Citrix
…

Causes acceptable amount of visual disruption to the user.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top