Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I am trying to generate a word document using c#.
My requirement is to automatically modify the word doc with the data s from the database.
For Eg:
For a Project that has 2 subprojects. we need 17 tables
This works fine .But in case of projects having more than 10 Subprojects.We are not able to open the Word doc.Although it s been created in the Respective folder


XML
string fileName = Server.MapPath(doc.PreparedClosureFileName);
        FileInfo file = new FileInfo(fileName);
        if (file.Exists)
        {

            string script = "frames['frmDownload'].window.location='Download.aspx?FileName=" + Server.UrlEncode(fileName) + "';";
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Download", script, true);
         }    </pre>





Regards,
Soumya
Posted
Comments
Zoltán Zörgő 21-May-12 6:51am    
Ok, and what's the error message you get?

1 solution

Surprisingly , we are not getting any Error message. Word doc is not getting opened automatically. As i ve told u earlier. This works fine for projects having less than 10 subprojects

Regards
Soumya
 
Share this answer
 
Comments
Zoltán Zörgő 21-May-12 7:47am    
Don't add comments as solution!

Have you checked with Fiddler for example what's happening between the client and the server? If you don't see it appearing, does not mean it is not downloaded.
By the way, you want to show a page with several Word documents opened in different frames?
Soumya Joseph 21-May-12 7:51am    
yea.. u r right.. word doc is already generated. but it doesnt appear.I am just trying to show a single word doc in a frame
Zoltán Zörgő 21-May-12 15:09pm    
What is the exact meaning of "subproject" in your case? Yow the generated (client side) html code looks like with 9 and with 11 subprojects? What is the difference? Try to understand or even debug with IE developer tools the html code. You will probably find something.
Soumya Joseph 21-May-12 23:54pm    
Yea... will do more debugging

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900