in

C1 Community

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

Autosize Flexgrid on C1PrintDocument

Last post 10-19-2007 4:46 AM by Wolfgang Knauf. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-15-2007 11:28 AM

    Autosize Flexgrid on C1PrintDocument

    I am trying to print a C1Flexgrid to a C1PrintDocument control where the width of the grid is larger than the printdocument width. 

     Doing this method

    .RenderBlockC1Printable(msgBindingChecklist, .BodyAreaSize.Width, 50, Nothing, StyleText)

    it will break the columns up between multiple pages.

    I then tried:

    Dim ro As New RenderC1Printable(doc)
    ro.Control = msgBindingChecklist
    ro.AutoWidth = True
    .RenderBlock(ro)

     

    This expands the grid from to fit the entire width of printable area past the margins. 

    Is there a way to get the grid to autosize down in size to fi twithin the margins set for the page without breaking off columns to the next page?

    Filed under: ,
  • 10-18-2007 11:48 AM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 527

    Re: Autosize Flexgrid on C1PrintDocument

    Have you tried this approach with C1FlexGridPrintable?

    Dim c1rp As New RenderC1Printable()
    c1rp.Object = C1FlexGridPrintable1
    Dim doc As New C1PrintDocument
    doc.Body.Children.Add(c1rp)

    by default the width will fill the page properly, but you can further set the width manually with

    c1rp.GenerateInnerRenderObjects()
    c1rp.Children(0).Width = "80%"

    Hope that helps
    GregL

    ComponentOne Technical Engagement
    Filed under: ,
  • 10-18-2007 12:55 PM In reply to

    Re: Autosize Flexgrid on C1PrintDocument

    Greg,

    Is this code for the Preview .NET Classic version?  For me to declare the RenderC1Printable object I must include the doc in the arguemnts, c1rp has .Control instead of .Object, and the doc doe snot have a .Body.  I should say that I am using the .NET 2.0 version of ComponentOne Studio, so I am not sure if there were changes made between the versions.  Even the documentation from the website for Preview .NET didn't have a mention to the .Body or .Children.  If this is the case, I'm sorry for not mentioning what verison I had.

  • 10-18-2007 4:04 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 527

    Re: Autosize Flexgrid on C1PrintDocument

    That code is done using C1PrintDocument from C1.C1Preview (different from C1.Win.C1Preview).

    Imports C1.C1Preview

    Regards,
    Greg L

    ComponentOne Technical Engagement
  • 10-19-2007 4:46 AM In reply to

    Re: Autosize Flexgrid on C1PrintDocument

    Hi !

    Two days ago, I posted a modified C1FlexGridPrintable sample with auto-scaling abilities. Maybe this is helpful for you:

    http://helpcentral.componentone.com/cs/forums/t/73345.aspx 

    Best regards

    Wolfgang Knauf

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