Hot Topic (More than 10 Replies) [Fixed] @XResultSetPrintReport and the Print Mode (Read 2219 times)
MP
Full Member
***
Offline



Posts: 104
Joined: Sep 3rd, 2007
[Fixed] @XResultSetPrintReport and the Print Mode
Nov 24th, 2007 at 12:26am
Print Post Print Post  
Fixed in 2.0.4

With Sesame v2.0.3, I'm having issues when using @XResultSetPrintReport.  It doesn't appear to be working as expected.  I've never called AlternateDefaultPrinter, and I tried resolving my problem by calling RestoreDefaultPrinter, but that did nothing.  I have multiple printers configured, with the default printer being my Brother Fax machine (connected on the parallel port).  And yes, I've checked 17 times and confirmed that it is setup in Windows XP as the Default Printer.  Here's what happens when I attempt to print with the following Mode settings:

REPORT_MODE_HTML - Opens an HTM document in Microsoft Word.
REPORT_MODE_HTML_PREVIEW - Opens an HTM document in my default browser.
REPORT_MODE_PRINT_ONLY - Opens an HTM document in Microsoft Word.
REPORT_MODE_PRINT_ONLY_PREVIEW - Nothing.

Unless I'm misunderstanding the intention of these modes, it appears that only REPORT_MODE_HTML_PREVIEW works as expected.  All others fail to work as expected.

Note that I have no issue printing to the default printer when printing using PrintString.
« Last Edit: Nov 30th, 2007 at 2:09pm by Hammer »  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @XResultSetPrintReport and the Print Mode
Reply #1 - Nov 24th, 2007 at 1:13am
Print Post Print Post  
AlternateDefaultPrinter will have no effect here. It only affects the PrintString family of commands.

For the PRINT_ONLY options, I believe that the defines in the sbasic_include.sbas may need updated. I can't check from here though. I'll let you know on Monday.

Edited:
The defines are not the problem. The ones that got changed involve dialog and background settings for a different command.
« Last Edit: Nov 26th, 2007 at 1:58pm by Hammer »  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @XResultSetPrintReport and the Print Mode
Reply #2 - Nov 24th, 2007 at 2:01am
Print Post Print Post  
It may be that you have the print setting for your .htm file associations setting wrong. Go to Control Panel and select Folder Options, select the the Tab labeled "File Types", select the .htm file extension and the Print "verb". Cut and paste, to here, what appears in the "Application used to perform action" text box.

There is a known bug with MS, wherein office installs itself as the print method for the .htm / .html file associations. Unfortunately, it doesn't know how to print. The bug is written up here: http://support.microsoft.com/kb/274527.



This may be the case. Though, if I remember correctly, the usual symptom of this is that no printing occurs with an html document. It is very odd that your OS is routing the print method of any file format directly into MSWord, unless that was intentionally set. That it could route a non-document (print only options) directly to a MSWord would indicate that the MSWord print previewer has been set as your printer.

If you are not seeing any result when using Print Only options, especially print only preview, there is likely something else wrong. Does your report print using the print only options if they are invoked from the report printing dialog box?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
MP
Full Member
***
Offline



Posts: 104
Joined: Sep 3rd, 2007
Re: @XResultSetPrintReport and the Print Mode
Reply #3 - Nov 26th, 2007 at 7:48pm
Print Post Print Post  
Quote:
There is a known bug with MS, wherein office installs itself as the print method for the .htm / .html file associations. Unfortunately, it doesn't know how to print. The bug is written up here: http://support.microsoft.com/kb/274527.

Oh my.  Good catch.  That's exactly (half) of my problem.
Quote:
If you are not seeing any result when using Print Only options, especially print only preview, there is likely something else wrong. Does your report print using the print only options if they are invoked from the report printing dialog box?

Using the Report Printing Dialog Box, I have no issue with Print Preview and Print.  However, after implementing the correction from MS, I'm currently experiencing the following:

REPORT_MODE_HTML_PREVIEW - Opens an HTM document in my default browser.
REPORT_MODE_HTML - Sends an HTM document to my default printer.
REPORT_MODE_PRINT_ONLY_PREVIEW - Nothing.
REPORT_MODE_PRINT_ONLY - Behaves identically to REPORT_MODE_HTML.

Since Erika has since reported that the constants file is correct, there must be something else going on.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @XResultSetPrintReport and the Print Mode
Reply #4 - Nov 26th, 2007 at 7:55pm
Print Post Print Post  
MP wrote on Nov 26th, 2007 at 7:48pm:
REPORT_MODE_PRINT_ONLY_PREVIEW - Nothing.


This one seems to be the only problem now.

Stupid question to get the obvious stuff out of the way: Are you certain that the Print Preview window is not appearing behind the main Sesame window?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
MP
Full Member
***
Offline



Posts: 104
Joined: Sep 3rd, 2007
Re: @XResultSetPrintReport and the Print Mode
Reply #5 - Nov 26th, 2007 at 8:04pm
Print Post Print Post  
Hammer wrote on Nov 26th, 2007 at 7:55pm:
MP wrote on Nov 26th, 2007 at 7:48pm:
REPORT_MODE_PRINT_ONLY_PREVIEW - Nothing.

This one seems to be the only problem now.

I disagree.  REPORT_MODE_PRINT_ONLY and REPORT_MODE_HTML should not behave identically.  REPORT_MODE_PRINT_ONLY should print in the Sesame native format.  As is, it's not different than REPORT_MODE_HTML.  Both generate an HTM file and then feed it to whatever command is defined as the Print command in Windows Explorer for HTM documents.

Hammer wrote on Nov 26th, 2007 at 7:55pm:
Stupid question to get the obvious stuff out of the way: Are you certain that the Print Preview window is not appearing behind the main Sesame window?

Yes.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @XResultSetPrintReport and the Print Mode
Reply #6 - Nov 26th, 2007 at 8:16pm
Print Post Print Post  
MP wrote on Nov 26th, 2007 at 8:04pm:
I disagree.  REPORT_MODE_PRINT_ONLY and REPORT_MODE_HTML should not behave identically.  REPORT_MODE_PRINT_ONLY should print in the Sesame native format.  As is, it's not different than REPORT_MODE_HTML.  Both generate an HTM file and then feed it to whatever command is defined as the Print command in Windows Explorer for HTM documents.


You are getting an HTM file with REPORT_MODE_PRINT_ONLY? Does @XResultSetPrintReport return its name?

This is weird. Can I please see the lines from your sbasic_include.sbas file where these constants are defined?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
MP
Full Member
***
Offline



Posts: 104
Joined: Sep 3rd, 2007
Re: @XResultSetPrintReport and the Print Mode
Reply #7 - Nov 26th, 2007 at 8:27pm
Print Post Print Post  
Hammer wrote on Nov 26th, 2007 at 8:16pm:
You are getting an HTM file with REPORT_MODE_PRINT_ONLY? Does @XResultSetPrintReport return its name?

Yup.  Yup.  Here's my code:
Code
Select All
vstrReturnValue = @XResultSetPrintReport( "Auction Checklist - Floor Price", vintResultSet, REPORT_MODE_PRINT_ONLY ) 


And here's the return value, as was dumped into the Slate:
C:\Program Files\Sesame2\Auction_Checklist___Floor_Price_2007_11_26_15_22_46.htm

Hammer wrote on Nov 26th, 2007 at 8:16pm:
This is weird. Can I please see the lines from your sbasic_include.sbas file where these constants are defined?

Sure.
Code
Select All
#define REPORT_MODE_HTML		0
#define REPORT_MODE_HTML_PREVIEW	1
#define REPORT_MODE_PRINT_ONLY		2
#define REPORT_MODE_PRINT_ONLY_PREVIEW	3 


  
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: @XResultSetPrintReport and the Print Mode
Reply #8 - Nov 26th, 2007 at 8:50pm
Print Post Print Post  
Hello MP,
You will need to add two entries to your ini file

Code
Select All
#define X_REPORT_MODE_PRINT_ONLY		100
#define X_REPORT_MODE_PRINT_ONLY_PREVIEW	102  



Use these two entries for @XResultSetPrintReport

I will write this up and pass it on to development.
  
Back to top
IP Logged
 
MP
Full Member
***
Offline



Posts: 104
Joined: Sep 3rd, 2007
Re: @XResultSetPrintReport and the Print Mode
Reply #9 - Nov 26th, 2007 at 9:04pm
Print Post Print Post  
Quote:
Use these two entries for @XResultSetPrintReport

Thanks, that did it.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @XResultSetPrintReport and the Print Mode
Reply #10 - Nov 26th, 2007 at 10:26pm
Print Post Print Post  
I knew I remembered seeing this go by!  Smiley

BTW, you will not need these defines when 2.0.4 releases. The fix is already in to make the normal defines work for this also. The special defines Ben gave you should only be used as a temporary workaround while we pack 2.0.4.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: @XResultSetPrintReport and the Print Mode
Reply #11 - Nov 27th, 2007 at 12:28pm
Print Post Print Post  
Quote:
You will need to add two entries to your ini file
Code
Select All
#define X_REPORT_MODE_PRINT_ONLY		100
#define X_REPORT_MODE_PRINT_ONLY_PREVIEW	102  


Defines in the ini file?
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @XResultSetPrintReport and the Print Mode
Reply #12 - Nov 27th, 2007 at 12:29pm
Print Post Print Post  
Infinity wrote on Nov 27th, 2007 at 12:28pm:
Quote:
You will need to add two entries to your ini file
Code
Select All
#define X_REPORT_MODE_PRINT_ONLY		100
#define X_REPORT_MODE_PRINT_ONLY_PREVIEW	102  


Defines in the ini file?


I think he means the include file.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged