7
Answers

Export From HTML with formatting in word document

Photo of Pravin Ghadge

Pravin Ghadge

7y
200
1
Hi All,
 
I am trying to export textbox string in word document with HTML formatting.
 
For Eg: (https://html-cleaner.com/)
<b> Hi </b>
 
After exporting the string it should give bold text in Word document.
 
But it is not working.
I have done lot of searching on google but not found solution.
 
Some links saying it is possible with Open XML Sdk. But i have not found any proper soluion
https://stackoverflow.com/questions/27147510/convert-html-to-word-format
https://stackoverflow.com/questions/18256812/convert-word-to-html-then-render-html-on-webpage
 
Plz advice.
 
i have attached my project (remove the package folder from project as file size is exceeding from 5 MB)

Attachment: ExportImport.zip

Answers (7)

0
Photo of mari muthu
NA 160 20.6k 7y
change this from your code(#DbContetxt);
  1. namespace Mvcpractice1.Models  
  2. {  
  3. public class EmployeeContext:DbContext  
  4. {  
  5. public EmployeeContext:base("EmployeeContext")  
  6. {  
  7.   
  8. }  
  9. public DbSet<Employee> Employees { getset; }  
  10. }  
  11. }  
0
Photo of Ramesh Palanivel
NA 9.5k 138.7k 7y
Hi Sangeetha,
 
Kindly check whether your database credentials are correct? The issue will happen due to inproper connection. 
0
Photo of mari muthu
NA 160 20.6k 7y
hi,
 
Seems like a connection issue. You can use the Data link properties to find if the connection is fine. Do the following:
  • Create a blank notepad and rename it to "X.UDL"
  • Double click to open it
  • Under connections tab choose the server name/enter the name use the correct credentials and DB
  • Click OK to save it.
Now open the file in Notepad and compare the connection string properties.