How to format the constructed document?

Home Forums Open-Xml-PowerTools How to format the constructed document?

This topic contains 2 replies, has 2 voices, and was last updated by  Eric White 8 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4012

    rogersb
    Participant

    Using DocumentBuilder01 Example, I was able to correctly get the results where my report document was opened and the first and last parts were copied then built into a new document.

    Very happy with that.

    But NOW?? comes the formatting. Im getting 2 items, a table thats 1100px wide and a bar chart thats 900px wide.

    Table and Chart are different sizes

    The groups should be the same size and 2-wide on the page

    the 2 groups should be the same size and fit 2-wide on the page

    • This topic was modified 8 years ago by  rogersb.
    #4014

    rogersb
    Participant

    do I need to use XElement to modify the size of the items? Im looking at the open xml sdk productivity tool 2.5 from the generated item. how do I resize the items

    XElement tbl = xDoc.Root.Element(W.body).Elements(W.tbl).FirstOrDefault();

    tbl.modifyDescendants(Outline)= new A.Outline(){ Width = 9525, CapType = A.LineCapValues.Flat, CompoundLineType = A.CompoundLineValues.Single, Alignment = A.PenAlignmentValues.Center };

    }`

    just a guess at how the part-Outline would be modified

    #4017

    Eric White
    Keymaster

    I am not completely clear on what the issue is with your markup. Are you attempting to change the markup for existing items where the size is not what you desire?

    In any case, you must not mix using XElement (LINQ to XML) with the strongly typed OM for the Open-Xml-Sdk.

    The best way to research the markup that you need to change is by creating two copies of a document, changing one slightly, and then using the Open-Xml-Sdk Productivity Tool to compare the two, highlight the differences.

    In the following screen-cast series, you can watch screen-cast #13:

    Introduction to Open XML

    Best, Eric

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.