question

JakubMitura-4240 avatar image
0 Votes"
JakubMitura-4240 asked HimanshuSinha-MSFT commented

export data to word document

I am using databricks for analysis of some clinical data - but in the end in order to include it into my Phd I need to put this data into editable document like google docs, microsoft word... and include there formatted tables (from data frames) text description (so I think about manually created template with placeholders for calculated values which would be automatically filled on the basis of some value from a given dataframe) and some visualizations for example from native databricks, power bi, or R ggplot2 ... .

I suppose problem is quite common, but I was not able to find any good solution

azure-databricks
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @JakubMitura-4240 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .In case if you have any resolution please do share that same with the community as it can be helpful to others . Otherwise, will respond back with the more details and we will try to help .
Thanks
Himanshu

0 Votes 0 ·

Hello @JakubMitura-4240 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .In case if you have any resolution please do share that same with the community as it can be helpful to others . Otherwise, will respond back with the more details and we will try to help .
Thanks
Himanshu

0 Votes 0 ·

1 Answer

HimanshuSinha-MSFT avatar image
0 Votes"
HimanshuSinha-MSFT answered

Hello JakubMitura-4240,
Thanks for the ask and using the Microsoft Q&A platform .
This is a great question and let me be honest here . I have not implemented anything like this , but when i think I believe we need to use the API for Google docs or Word to achieve what you are trying to use . There is no out of the box solution when I found ( inline with what you mentioned ) .

I could like to point you to python-docx here . I did tried a basic python to create a *.docx and it worked . Since Adb does support Python , I think you should explore more on this .

 from docx import Document
 from docx.shared import Inches
    
 def WriteADoc():
    
     print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.
     document = Document()
    
     document.add_heading('Document Title', 0)
     document.save('demo.docx')
    
    
 if __name__ == '__main__':
    WriteADoc()

Please do let me know how it goes .
Thanks
Himanshu
Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.