in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Print to non-standard printer with header/footer

Last post 05-22-2008 6:02 PM by tosch. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 04-21-2008 5:15 AM

    • tosch
    • Not Ranked
    • Joined on 05-24-2006
    • Posts 16

    Print to non-standard printer with header/footer

    I just can't get to print a TrueDBGrid to the non standard printer including headers/footers.

    Does anyone have a sample on how to achieve this?

    I read a post on how to print to to a non standard printer which works fine. But I can't set any headers/footers.

    When I set the printername in the printinfo structure headers/footers are printed but the printername is not honoured.

    So is there a chance to do both at the same time?

    Tosch 

  • 04-23-2008 1:58 AM In reply to

    Re: Print to non-standard printer with header/footer

    Can you please post the code snippet for the PrintInfo method?
     
    Regards,
    Sam Xavier
    <tosch> wrote in message news:204085@10.0.1.98...

    I just can't get to print a TrueDBGrid to the non standard printer including headers/footers.

    Does anyone have a sample on how to achieve this?

    I read a post on how to print to to a non standard printer which works fine. But I can't set any headers/footers.

    When I set the printername in the printinfo structure headers/footers are printed but the printername is not honoured.

    So is there a chance to do both at the same time?

    Tosch 



    http://helpcentral.componentone.com/cs/forums/p/75018/204085.aspx#204085

  • 04-23-2008 4:20 AM In reply to

    • tosch
    • Not Ranked
    • Joined on 05-24-2006
    • Posts 16

    Re: Print to non-standard printer with header/footer

    Sam,

    here's my code I use for printing. Everything prints ok except on the wrong printer. It's always printing on my default printer and not on the one I specified.

     

            Dim MyPrintername As String = "\\SERVER01\HP CLJ 3800" 

            With Me.C1TrueDBGrid1.PrintInfo
                .PageSettings.PrinterSettings.PrinterName = MyPrintername
                With .PageSettings
                    .Landscape = True
                    .Margins.Bottom = 100 / 254
                    .Margins.Top = 100 / 254
                    .Margins.Left = 100 / 254
                    .Margins.Right = 100 / 254
                End With

                Dim fntFont As New Font("Arial", 10)
                .PageHeaderStyle.Font = fntFont
                .PageHeader = "This is a header"

                .PageFooterStyle.Font = fntFont
                .PageFooter = "This is a footer / Page \p"

                .RepeatColumnHeaders = True
                .WrapText = C1.Win.C1TrueDBGrid.PrintInfo.WrapTextEnum.Wrap
                .UseGridColors = True
                .PageBreak = C1.Win.C1TrueDBGrid.PrintInfo.PageBreaksEnum.FitIntoArea

                .ShowProgressForm = True

                .Print()

            End With

     

     

    Thomas 

  • 04-30-2008 2:20 AM In reply to

    • tosch
    • Not Ranked
    • Joined on 05-24-2006
    • Posts 16

    Re: Print to non-standard printer with header/footer

     Sam,

    any news on this problem?

     

    Thomas 

  • 05-08-2008 3:19 AM In reply to

    • tosch
    • Not Ranked
    • Joined on 05-24-2006
    • Posts 16

    Re: Print to non-standard printer with header/footer

    Anyone from support still monitoring the entries in this forum?

    I have posted some code here about 10 days ago and havent heard anything back. Please let me know what's happening.

    Thomas

  • 05-15-2008 12:29 AM In reply to

    Re: Print to non-standard printer with header/footer

    Hi Thomas,
    Please test this out with the latest version. You may download it from here:
     
    Regards,
    Sam Xavier
    <tosch> wrote in message news:204662@10.0.1.98...

    Anyone from support still monitoring the entries in this forum?

    I have posted some code here about 10 days ago and havent heard anything back. Please let me know what's happening.

    Thomas



    http://helpcentral.componentone.com/cs/forums/p/75018/204662.aspx#204662

  • 05-16-2008 3:19 AM In reply to

    • tosch
    • Not Ranked
    • Joined on 05-24-2006
    • Posts 16

    Re: Print to non-standard printer with header/footer

    Sam,

    i have downloaded TrueDBGrid (and Preview) and this is still not working for me.

    Before the TrueDBGrid.PrintInfo.Print I have checked the printer name and it was correct. But TrueDBGrid still printed on the default printer.

     Does this work for you? Can you send me the code you're using?

    Thomas 

  • 05-22-2008 11:31 AM In reply to

    Re: Print to non-standard printer with header/footer

    Hi Thomas,
    This seems to be a machine specific issue to me as using your code snippet itself, we are not able to replicate this issue on any of our test machines.
    If we specify a printer name (other than default), then on the Print method, an exception is being raised that the specified printer could not be found. The printer's name was an invalid name so this exception was thrown.
    If we specify any valid printer name then the Print is being executed on the provided printer name rather than on the default printer.
    I have also attached a screenshot for the same.
     
    Regards,
    Sam Xavier
    <tosch> wrote in message news:204919@10.0.1.98...

    Sam,

    i have downloaded TrueDBGrid (and Preview) and this is still not working for me.

    Before the TrueDBGrid.PrintInfo.Print I have checked the printer name and it was correct. But TrueDBGrid still printed on the default printer.

     Does this work for you? Can you send me the code you're using?

    Thomas 



    http://helpcentral.componentone.com/cs/forums/p/75018/204919.aspx#204919

  • 05-22-2008 6:02 PM In reply to

    • tosch
    • Not Ranked
    • Joined on 05-24-2006
    • Posts 16

    Re: Print to non-standard printer with header/footer

     What version did you use to test this?

     

    Thomas 

Page 1 of 1 (9 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.