Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] Landscape not working (CreatePrintView)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Landscape not working (CreatePrintView)

 Post Reply Post Reply
Author
Message
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Landscape not working (CreatePrintView)
    Posted: 30 September 2010 at 6:30am
Hi,

This doesn't work in the last release :

    Me.ReportControl1.PrintOptions.Landscape = True
    Me.PrintPreview1.PrintView = ReportControl1.CreatePrintView()

Seems that "CreatePrintView" always create report in portrait mode !!!
See this sample and please make a fast update, my customers and my boss are really angry...

Regards,
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 30 September 2010 at 2:18pm
Hi,

It's late in the day so I am not in the office to check this out, but can I ask why you are using the PrintPreview control to print the data from the ReportControl?

The reason I ask is that the ReportControl has the ability to open an inbuilt Print Preview, which works in both Landscape or Portrait!

But I do think there is a way of changing the PrintPreview control to print in both too. I will check this tomorrow when I get into the office.
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 01 October 2010 at 3:54am
Hi,

Well I have tried your code on v13.4.0 and all seems to work fine, what version are you using?

I created a small example to test this and it both displays and prints in Landscape (see screenshot attached), is have also attached the test version I created uploads/2960/PrintPreview.rar.




Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 01 October 2010 at 4:16am
Originally posted by Xander75 Xander75 wrote:

 what version are you using?

Hi,

As I said, it works fine with 13.4.0.

I use PrintPreview with ReportControl because :

1) The look of print preview is better (command bars VS buttons)
2) It's easy to change the captions of the buttons in printpreview (you just have to get the CommandBar object and use it)
3) I need to customize the available's actions when the printpreview is shown. For Example, on my print preview form I've added a checkbox in the commandbar to switch between "portrait" and "Landscape" mode.

Anyway, thank you for your replies, if CJ could do the same...


Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 01 October 2010 at 6:05am
Hi,

I understand why you prefer to use the PrintPreview control as I use this for the same reasons.

Well it looks like a possible bug in the latest version unless there's a way to resolve it, however you should report the Bug at http://www.codejock.com/support/

When reporting it I would link them to this thread.
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 01 October 2010 at 6:47am
Originally posted by Xander75 Xander75 wrote:

Hi,

I understand why you prefer to use the PrintPreview control as I use this for the same reasons.


When reporting it I would link them to this thread.

I've done it yesterday. Issue : #25375
No answer for the moment.

Thanks for your help.
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2010 at 4:17am
For the moment I have not heard of the support on this ...
I will return to 13.4.0 and I'll live with the other bugs, a little less serious ...
To 14.0, consider making the tests a bit more advanced or, if you do not have time, thank you to provide your users a beta version. This kind of bug is very destabilizing.The quality of your components and our software depends on it.
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2010 at 8:30am
Hi,

To allow everything to print with landscape mode, PrintPreview control now just have own Orientation mode.
Please use it instead:

Me.PrintPreview1.Orientation = xtpOrientationLandscape
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2010 at 12:25pm
Originally posted by oleg oleg wrote:

Hi,

To allow everything to print with landscape mode, PrintPreview control now just have own Orientation mode.
Please use it instead:

Me.PrintPreview1.Orientation = xtpOrientationLandscape

Thank you Oleg.
Seems that it works.

Don't you think that such kind of change should be highlighted in change log !?
When an update need your customers to change their code it's the least to do ! 
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2010 at 1:47pm
ok, Great.

There is note about Orientation in release notes.   maybe only not obvious what to do with it :)

PrintPreview.Orientation property added
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2010 at 2:40pm
What is sad is that it does not indicate that the property is used in place of the one of the report control when you use them together !

Maybe the printpreview could use the report control property on initialize ?

But this is not important, now it works.

Thanks for your help.
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 13 January 2011 at 11:28am
Originally posted by Lodep59 Lodep59 wrote:


Hi,

As I said, it works fine with 13.4.0.

I use PrintPreview with ReportControl because :

1) The look of print preview is better (command bars VS buttons)
2) It's easy to change the captions of the buttons in printpreview (you just have to get the CommandBar object and use it)
3) I need to customize the available's actions when the printpreview is shown. For Example, on my print preview form I've added a checkbox in the commandbar to switch between "portrait" and "Landscape" mode.

Anyway, thank you for your replies, if CJ could do the same...


 
Hi,
 
I need to add some functionality too... Adding buttons isn't the problem but how to catch click event for the newly added button? I tried a lot but didn't succeed. Can I ask you how you did this?
 
Thanks
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 14 January 2011 at 8:36am
Hi Aaron,

In fact I think it's impossible if you use the print preview toolbar because you don't have access to the "execute" method of the toolbar. So you can add controls but there's no way to catch the click event.

In my case, I customize the labels of the printpreview commandbar controls and I've added a second command bar in the bottom of the printpreview wich is used as usual.

The printpreview control is very helpfull because you can place it on a form and add others controls. The printpreview function of the report control is easy to use but you can't customize the controls shown on the form.

Hope this help.
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 15 January 2011 at 3:23am

Hi,

Thanks for reply.

Too bad, there's no event you can catch. For now I removed 'close' button and added seperator and checkbox (only to toggle 'preview' Landscape and Portrait) with same ID as 'close' button and I'm able to use Close event to add necessary code. 
Well, at least you are able to access the toolbar and set new captions and tooltips. Would be nice though if we could add some more... CJ??? Wink
 
Thanks
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2011 at 4:59am
Hi Aaron,
 
As there is no direct way of catching the event you could add Custom Controls i.e. Combo, CheckBox etc. I have done this with a ComboBox and it works fine, this way you can add many controls to the toolbar and leave the Close event to close the PrintPreview.
 
See below example for adding a ComboBox for printer orientation:
 

Private Sub Combo1_Change()
    PrintPreview.Orientation = IIf(Combo1.Text = "Landscape", xtpOrientationLandscape, xtpOrientationPortrait)
End Sub  
Private Sub Combo1_Click()
    Call Combo1_Change
End Sub  
Private Sub Form_Load()
   
    Dim Control As XtremeCommandBars.CommandBarControl
    
    With Combo1
        .AddItem "Landscape"
        .AddItem "Portrait"
        .Text = "Portrait"
    End With
    
    Set Control = CommandBars.CreateCommandBarControl("CXTPControlCustom")
    Control.Handle = Combo1.hWnd
            
    PrintPreview.Toolbar.Controls.AddControl Control
   
End Sub
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2011 at 3:20pm

Hi,

Thanks for reply. That could be an option too but I decided to add extra commandbars to PictureBox (with PrintPreview inside as well and using Dockingpanes). I added toolbar the toolbar and changed some properties for PrintPreview Toolbar. Just in case CJ implements the Execute/Update event, the only thing I have to do is copy/paste some code to get this fully functional.

If you don't use Dockingpanes this is an OK solution Wink without having to position/size the solution I decided to use.
 
btw. This post shows what a forum is about, different members with different solutions. We should do this more often Wink
 
This is what I did: (note: PrintPreview & CommandbarsExtra inside PictureBox & DockingPanes
 
Private Function CreatePrintPreviewToolbar()
    'Set same properties for both toolbars because I had to position new toolbar to top-left
    'and right beneath new toolbar, the PrintPreview toolbar resides because it is positioned
    'through ResizeClient event.

    With Me.PrintPreview
        .VisualTheme = xtpThemeNativeWinXP
        With .Toolbar
            .ShowGripper = False
            .ContextMenuPresent = False
            .Customizable = False
            .CustomizeDialogPresent = False
            .ShowExpandButton = False
            .EnableDocking xtpFlagStretched
        End With
    End With
   
    With Me.CommandBarsPrintPreviewExtra
        .DeleteAll
        .VisualTheme = xtpThemeNativeWinXP
       
        With .Add("Test", xtpBarTop)
            With .Controls
                .Add xtpControlCheckBox, 1000, "Landscape"
                '.Add ........
            End With
            .ShowGripper = False
            .ContextMenuPresent = False
            .Customizable = False
            .CustomizeDialogPresent = False
            .ShowExpandButton = False
            .EnableDocking xtpFlagStretched
        End With
    End With
   
End Function
 
Private Sub CommandBarsPrintPreviewExtra_ResizeClient(ByVal Left As Long, ByVal Top As Long, ByVal Right As Long, ByVal Bottom As Long)
    Me.PrintPreview.Move Left, Top, Right - Left, Bottom - Top
End Sub
Output:
 
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.