Print landscape does not work

Posted by: dror_farhi on 30 May 2018, 4:43 am EST

  • Posted 30 May 2018, 4:43 am EST

    I have an active x control that I am using on vb6:
    FarPoint Spreadsheet control version: 2.5.0.1
    I am using the object of type: vaSpread

    I print a grid with .action = ACTION_SMARTPRINT '32
    If the grid does not fit in portrait orientation, it is printed in landscape orientation.

    Now, some of the printers does not print the grid.
    When I change the grid to fit in portrait orientation (by resizing columns), these printers print it in portrait orientation.
    We decided to print it always as landscape so the grid will always fit the page.
    When I put the line:
    .PrintOrientation = vbPRORLandscape
    The printers still don't print the page.
    I read on the internet that .PrintOrientation needs to be set before PrintSheet, but I don't have the method PrintSheet.

    What should I do in order to print the grid in landscape orientation ?



  • Replied 31 May 2018, 2:01 am EST

    Hello,

    Spread v2.5.0.1 is a very old product and is not under development for last last 12 years. I would suggest you to test this issue with the latest version of Spread COM v8.0.28. Th code to print with Lanscape orientation using Spread 8 is as follows:


    void CTestDlg::OnButton1()
    {
    VARIANT x;

    x.vt = VT_I4;
    x.lVal = 1;
    // Define the header text
    m_Spread1.SetPrintHeader("/cFiscal Year 1997");
    m_Spread1.SetPrintFooter("DRAFT COPY/rDRAFT COPY");
    // Print in landscape orientation
    m_Spread1.SetPrintOrientation(PrintOrientationLandscape);
    // Print the third sheet
    m_Spread1.SetSheet(3);
    // Print the sheet
    m_Spread1.PrintSheet(&x);
    }


    Thanks,
    Deepak Sharma
  • Replied 31 May 2018, 3:53 am EST

    It's not my decision to upgrade our control to v8.0.28 or to stay with v2.5.0.1. I'm working in a company. Is there a way to do it with v2.5.0.1 ?

    Thanks.

  • Replied 1 June 2018, 1:43 am EST

    Hello,

    I am afraid that we will not able to test this issue with Spread 2.5 COM.
    I would suggest you to please test this issue with the latest version and let us know in case the issue still persists.


    Thanks,
    Deepak Sharma
  • Replied 3 June 2018, 4:11 am EST

    I know that the issue does not persist in the latest version. I know how to print landscape in Spread 8.5. I need to print landscape in Spread 2.5.

    Thanks.
  • Replied 4 June 2018, 12:33 am EST

    Hello,

    Since we don't have any way to check the issue with version 2.5. Hence, we are asking our developers if they can help in this issue.

    We will get back to you as soon as we hear anything from them.

    Thanks,
    Reeva
  • Replied 4 June 2018, 3:24 am EST

    Thanks :),
    Dror
  • Marked as Answer

    Replied 4 June 2018, 1:58 pm EST

    Hi,

    Using the old Spread COM version 2.5 API, setting the Action property to 32 (ACTION_SMARTPRINT) is equivalent to calling the newer PrintSheet method after setting the property PrintSmartPrint = true.

    And setting PrintOrientation = 2 (SS_PRINTORIENT_LANDSCAPE) before setting the Action property should make the printer use landscape orientation for the document. Are you sure that your project is defining vbPRORLandscape = 2 somewhere? I suggest hard-coding the value 2 for PrintOrientation and see if that works.

    Regards,
    Sean Lawyer
    Product Manager
  • Replied 5 June 2018, 5:38 am EST

    Hi,
    This is my code:

    With MySpread
    .PrintBorder = True
    .PrintColHeaders = True
    .PrintRowHeaders = True
    .PrintColor = False
    .PrintGrid = True
    .PrintJobName = MyJobName
    .PrintShadows = True
    If MyStartPage <> 0 And MyEndPage <> 0 Then
    .PrintType = SS_PRINT_PAGE_RANGE
    .PrintPageStart = MyStartPage
    .PrintPageEnd = MyEndPage
    Else
    .PrintType = SS_PRINT_ALL
    End If
    .PrintUseDataMax = True
    .PrintHeader = MyHeader
    .PrintFooter = MyFooter
    .PrintMarginTop = 100
    .PrintMarginBottom = 30
    .PrintMarginLeft = 500
    .PrintMarginRight = 500
    .PrintAbortMsg = MsgArray(db_PrintInfo)
    .Action = SS_ACTION_SMARTPRINT
    End With

    When I put .PrintOrientation = 2 before the line: .Action = SS_ACTION_SMARTPRINT '32
    I'm getting the error: 2147417848 and nothing is printed

    When I put .PrintOrientation = 2 and after that the line: .Action = SS_ACTION_PRINT '13 instead of SS_ACTION_SMARTPRINT
    I'm getting the error: 2147417848 and nothing is printed

    What should I do ?

    Thanks,

    Dror
  • Replied 7 June 2018, 6:51 am EST

    Hello Dror,

    We have asked our developers to look into this issue. We will get back to you as soon as we hear anything from them.

    Thanks,
    Reeva
  • Replied 7 June 2018, 6:51 am EST

    Hello Dror,

    We have asked our developers to look into this issue. We will get back to you as soon as we hear anything from them.

    Thanks,
    Reeva
  • Replied 7 June 2018, 10:14 am EST

    Hi,

    Please try this newer build of the 32-bit Spread 2.5 OCX control, version 2.5.0.25:
    http://download.componentone.com/pub/Spread25/ss32x25.zip

    Please note that you should backup your project files before updating and using this version in your project, as it contains breaking changes to the BLOB data format (binary info saved inside the FRX file) that cannot load into the older releases.

    Please also note that build is intended for licensed customers, and requires that the developer license already be installed on the machine in order to work for development. You will need to follow the directions in the readme and register the control.

    I'm afraid if that build doesn't work, we can't help; that's the last build of Spread version 2.5 and you would need to upgrade the controls to a newer version (such as version 8) in order to try a newer build.

    Please note that the latest version 8 controls can replace your existing version 2.5 controls seamlessly (assuming that you are not using the DataSource property to bind the sheet). There are detailed upgrade instructions in the readme.chm for Spread 8 which describe how to upgrade your project files:
    http://help.grapecity.com/spread/Spread_COM_ReadMe/webframe.html#up30udvb.html
    Those steps linked above describe how to upgrade project files from Spread COM 3.0 DAO (ss32x30.ocx) to Spread COM 8 Unicode ADO (fpSpru80.ocx) -- upgrading from the older Spread COM 2.5 DAO control follows the same steps, except for the file name and OCX version parts (you would need to change "#2.5#0" and "SPR32X25.OCX").

    Regards,
    -Sean


  • Replied 10 June 2018, 3:35 am EST

    Hi Sean,

    Thanks for your answer.

    I am afraid the managers will not let me upgrade from version 2.5.0.1 to version 2.5.0.25, cause we are very close to our version release. Maybe in our next version release.
    I will fix it by changing our table to always fit into portrait.

    Best Regards,

    Dror
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels