Page 1 of 1

[AX V8 - VB6 SP6] teechart does not retreive default print

Posted: Sat Apr 01, 2017 11:01 am
by 15053514
Goodmorning,

we have an issue with a DesktopApp developed in Vb6 on OS Windows 10.
The problem is that teechart component don't retreive all properties from default printer.
This cause error "operation not supported on selected printer" if i programmatically change some properties about printer reference.

In example:
I want to change printer orientation from Protrait to Landscape and print the chart.
If i change the Orientation property without Confirm the printer devide by ShowSetupDlg method, i receive the error listed above and print output is blank.
Against if i confirm it using that method, the print process work fine.

This issue is only on Windows 10 OS (in all older systems this dows not occour).

P.S. Teechart8.ocx version is the latest (8.0.1.3)

In attachment a simple project to explain the issue (exe must be run on win10)

Best regards,

Lorenzo Lavezzo

Re: [AX V8 - VB6 SP6] teechart does not retreive default print

Posted: Tue Apr 04, 2017 1:26 pm
by yeray
Hello,

It works fine for me with TeeChart v8.0.1.1 if I change this line from your Form2:

Code: Select all

.PrintPartialHandle Printer.hDC, x, Y, TChart1.Printer.PageWidth, TChart1.Printer.PageHeight
for this:

Code: Select all

.PrintPartialHandle Printer.hDC, x, Y, Form1.TChart1.Printer.PageWidth, Form1.TChart1.Printer.PageHeight

Re: [AX V8 - VB6 SP6] teechart does not retreive default print

Posted: Wed Apr 05, 2017 7:57 am
by 15053514
Hello,

my ocx version is v8.0.1.3.
I've applied the fix to the code, but still having same error on TeePreviewPanel when i try to change printer orientation.

I've tried to downgrade Teechart8.ocx at V8.0.1.1 and it works.
But this is a "work around", what is the change log between v8.0.1.1 and v8.0.1.3?

Can i hope into a Fix on v8.0.1.3 component? I've hundreds installations into the world...

Best Regards,

Lorenzo Lavezzo

Re: [AX V8 - VB6 SP6] teechart does not retreive default print

Posted: Wed Apr 05, 2017 9:06 am
by yeray
Hello,

I've tried with v8.0.1.3 and I'm not able to reproduce the problem either with it.
I'm not sure if I should do anything special to reproduce it. I'm adding selecting an orientation and pressing "Print".

BTW, I've changed the code in Option1_Click to make the options match the print and preview orientations.
I've also added the TeeChart version in use to the title.
test win10.zip
(9.74 KiB) Downloaded 1298 times

Re: [AX V8 - VB6 SP6] teechart does not retreive default print

Posted: Thu Feb 01, 2018 10:42 am
by Marc
...a note on this. During checks, reviewing this sample code, we have noticed that the return string for TeeChart Printer DeviceName, that influences the loop that sets the environment printer, includes spurious characters at the end of the devicename string. That causes the code not to enter the loop.

Code: Select all

        If Mid(a.DeviceName, 1, Len(Form1.TChart1.Printer.PrinterSettings.DeviceName)) Like Form1.TChart1.Printer.PrinterSettings.DeviceName Then
              Set Printer = a
              Printer.PaperSize = Form1.TChart1.Printer.PrinterSettings.PaperSize
              If Form1.TChart1.Printer.PrinterSettings.Orientation = vbPRORPortrait Then
                  Printer.Orientation = vbPRORPortrait
              Else
                  Printer.Orientation = vbPRORLandscape
              End If
        End If
As partial check on the first part of the string rather than a check over the whole string might be better placed here. This is resolved as part of bugfix: http://bugs.teechart.net/show_bug.cgi?id=1983

Regards,
Marc Meumann