Reporting (docx writer) and Styles

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

AleV wrote at 2012-10-16 18:59:

I'm happily using the reporting module and I find very useful.

I'd like to be able to specify a default style for the whole table (for the docx export) and not for the text inside the table.  Is it possible?

Also, is there a way to put some content (other than text of course) inside a cell of a table? My intent is to keep multiple charts aligned in my docx document.


objo wrote at 2012-10-16 23:55:

Great to hear that you find the simple reporting classes useful! 

Do you need to set spacing/indentation? Or other table properties? It should be possible to add such a style for the table elements, and I think this could be supported by all the output formats (html, pdf, xps, docx)

Note that this reporting model was designed to be *very* simple, so currently the table cells can only contain text. I will refactor to a more flexible model later (I would also like to have more control of the inline content of the paragraphs).

Check out the OpenXML SDK if you need full control of your docx output. http://www.microsoft.com/en-us/download/details.aspx?id=5124


AleV wrote at 2012-10-17 15:18:

Thanks objo, as far as I understand of your object model, a OxyPlot.Reporting.ReportStyle only specifies the font family of the text, the text of the table or the text of the table headers and they are all "Paragraph Styles".

As you probably know in Word a Style there are different type of styles ("Paragraph", "Character", ..., "Table"): what I'd like to be able to do is to format a table with a table style (for example by applying the Word 2010 built-in "Light Shading - Accent 5 style"), rather than with a paragraph style for the content of the cells. But maybe this is something too specific to docx (or HTML): I have no idea if this also applies to tex, xps or pdf.

Finally, is it possible to put content in the header and footer of the document?

Anyway, thanks a lot for your beautiful software.

 

 

 

 

 


objo wrote at 2012-10-17 15:37:

Yes, the style is only defining paragraph properties. I see some refactoring may be necessary.

I would like to add a feature that creates the document from a Word template file, then I think it should be possible to put all Word-specific styles in there. It should also be possible to add headers and footers (including graphics) in the template file. I have added the feature in http://oxyplot.codeplex.com/workitem/10011

Sorry, I don't have time to implement this right now. But I need it myself in a couple of months from now :)


AleV wrote at 2012-10-17 15:42:

That would be great!