We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Cannot open storage

Hi, I am currently evaluating DocIO for use on one of our websites. I have a WYSIWYG control that outputs XHTML, I understand DocIO cannot load XHTML so I created the word document as follows Dim filename As String = HttpContext.Current.Server.MapPath("~/Templates/") & "temp.doc" Dim sw As New StreamWriter(filename) sw.Write(documentContent) sw.Close() sw.Dispose() This created the Wrod document which I then tried to load into DocIO so that I could format the doc, add footers etc Dim document As IWordDocument = New WordDocument(filename) This errors saying "Cannot open storage. File Name is: ........." Am I doing something wrong or can you suggest an alternative method of doing this? Thank you

6 Replies

AD Administrator Syncfusion Team June 12, 2006 01:27 PM UTC

documentContent is the XHTML from the WYSIWYG control


AD Administrator Syncfusion Team June 12, 2006 01:29 PM UTC

having read some other posts, I tried using Dim convertor As HTMLToDLS = New HTMLToDLS() convertor.Convert(document, documentContent) but this does not format the HTML tables correctly, is there a bug in this?


AD Administrator Syncfusion Team June 12, 2006 01:45 PM UTC

I have found the problem to be that HTMLToDLS does not honour the colspan property, is this a known bug?


AD Administrator Syncfusion Team June 13, 2006 03:07 PM UTC

Hi David, Sorry for delaying in getting back to you and thanks for the code snippet. 1) StreamWriter Class can create only files with text format. But the problem was you are tried to create a word document and the created document is in text format with .doc extension. It only throws “Cannot open storage. File Name is: .........” exception because of it. Instead of creating a document, could you try to create a text file and append its contents with your HTML code and then use StreamReader Class; you can read all the contents from the text file and convert it into a document. I have created a sample for this operation. I hope this will resolve your problem. Sample : HTMLToDoc_Streams.zip Please take a look and let me know if you have any questions. 2. Yes, I was able to see the problem with colspan. I will contact the development team regarding it and send you an update as soon as possible. Thanks, Prabhu.


PR Prasad April 3, 2008 05:49 PM UTC


Hi Prabhu,
I am evaluating SyncFusion for our project. Here I am opening word doc file only with .doc extension, I am getting the same error. "Cannot open storage. File Name is...".

What is the reason?

Thanks
Prasad
>Hi David,
>
>Sorry for delaying in getting back to you and thanks for the code snippet.
>
>1) StreamWriter Class can create only files with text format. But the problem was you are tried to create a word document and the created document is in text format with .doc extension. It only throws “Cannot open storage. File Name is: .........” exception because of it.
>
>Instead of creating a document, could you try to create a text file and append its contents with your HTML code and then use StreamReader Class; you can read all the contents from the text file and convert it into a document. I have created a sample for this operation. I hope this will resolve your problem.
>
>Sample : HTMLToDoc_Streams.zip
>
>Please take a look and let me know if you have any questions.
>
>2. Yes, I was able to see the problem with colspan. I will contact the development team regarding it and send you an update as soon as possible.
>
>Thanks,
>Prabhu.
>



AD Administrator Syncfusion Team April 4, 2008 08:48 AM UTC

Hi Prasad,

Thank you for your interest in Syncfusion prodcuts.

Could you pleaseyo provide ur file to reproduce this issue in our end, so that we would investigate more on this issue.

Best Regards,
Bhuvana


Loader.
Live Chat Icon For mobile
Up arrow icon