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

TeeChart for ActiveX, COM and ASP
Post Reply
Lorenzo Lavezzo
Newbie
Newbie
Posts: 2
Joined: Mon Jun 22, 2009 12:00 am
Contact:

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

Post by Lorenzo Lavezzo » Sat Apr 01, 2017 11:01 am

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
Attachments
test win10.rar
(9.24 KiB) Downloaded 198 times

Yeray
Site Admin
Site Admin
Posts: 8704
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Tue Apr 04, 2017 1:26 pm

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
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Lorenzo Lavezzo
Newbie
Newbie
Posts: 2
Joined: Mon Jun 22, 2009 12:00 am
Contact:

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

Post by Lorenzo Lavezzo » Wed Apr 05, 2017 7:57 am

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

Yeray
Site Admin
Site Admin
Posts: 8704
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Wed Apr 05, 2017 9:06 am

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 198 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Marc
Site Admin
Site Admin
Posts: 920
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

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

Post by Marc » Thu Feb 01, 2018 10:42 am

...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
Steema Support

Post Reply