Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2006

Tip: Looking for answers? Try searching our database.

Word template to be filled by the server in aspnet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sweetpotatop@yahoo.com - 13 Feb 2006 19:07 GMT
Hello,

I wonder how I can populate the fields of a Word template in asp.net.
Please note that data will be coming from a DB on the server.

Thanks in advance.
Terry Burns - 13 Feb 2006 20:19 GMT
You need to be more specific in 'exactly' what you are trying to acheive.

Signature

Terry Burns
http://TrainingOn.net

> Hello,
>
> I wonder how I can populate the fields of a Word template in asp.net.
> Please note that data will be coming from a DB on the server.
>
> Thanks in advance.
sweetpotatop@yahoo.com - 13 Feb 2006 20:30 GMT
I have a word template in which I define lots of bookmark (textbox for
user input).

I am going to populate those bookmark or texboxes with info from a
Database, and display it to the user.

How can that be done? Since I won't be able to use
CreateObject("Word.application") due to permission issue.

But on the client-side script, I can't do it either, as I don't know
how I can pass my DB data from the server to the client.

Can I do it through XML, but I am a newbie.. Please help!

Thanks in advance. Your help would be greatly appreciated.

> You need to be more specific in 'exactly' what you are trying to achieve.
>
[quoted text clipped - 8 lines]
> >
> > Thanks in advance.
Terry Burns - 13 Feb 2006 21:52 GMT
What is the permission issue ?, using COM is probably going to be what you
will use. Alternatively, if you are using 2005 an Word 2003 + you can use
code-behind.

Signature

Terry Burns
http://TrainingOn.net

>I have a word template in which I define lots of bookmark (textbox for
> user input).
[quoted text clipped - 24 lines]
>> >
>> > Thanks in advance.
sweetpotatop@yahoo.com - 14 Feb 2006 14:00 GMT
Hi Terry,

The permission issue is I have to create an ASPNET account and grant
permission to that account for accessing the Word.Application object!

> You need to be more specific in 'exactly' what you are trying to acheive.
>
[quoted text clipped - 8 lines]
> >
> > Thanks in advance.
Steve C. Orr - 13 Feb 2006 23:01 GMT
There are many ways to export to Word (and Excel), most of which are outlined
here:
http://SteveOrr.net/articles/ExportPanel.aspx
http://SteveOrr.net/articles/ExcelExport.aspx

There are also some good 3rd party tools that can provide advanced merging
functionality much more easily:
http://SteveOrr.net/reviews/AsposeWord.aspx
http://SteveOrr.net/reviews/OfficeWriter.aspx

Signature

I hope this helps,
Steve C. Orr
MCSD, MVP
http://Steve.Orr.net

> Hello,
>
> I wonder how I can populate the fields of a Word template in asp.net.
> Please note that data will be coming from a DB on the server.
>
> Thanks in advance.
sweetpotatop@yahoo.com - 14 Feb 2006 14:05 GMT
I read your second link, which is a really good  solution, however, I
have around 5-10 files for each account (users) and the content/data in
the file is client-specific, which means I have tons and tons of files
sitting on my sever if I am going to save them before I send to the
client's brower. Is there a way for clean up?

Thanks in advance.
sweetpotatop@yahoo.com - 14 Feb 2006 17:17 GMT
Btw, I got the following error when I tried to open my word document:

System.Runtime.InteropServices.COMException: Could not open macro
storage.

Code:
oDoc = oWord.Documents.Add(tempPath & tempName & ".doc")

Is there a way to skip creating an user account in the server, as I
know this is not a good practice.

Or can I do this in some other way, like xml, but my document is in
Word format, with grids...

Thanks in advance.

> I read your second link, which is a really good  solution, however, I
> have around 5-10 files for each account (users) and the content/data in
[quoted text clipped - 3 lines]
>
> Thanks in advance.
Steve C. Orr - 14 Feb 2006 21:29 GMT
If you're going to attempt COM Interop with Office on the web server (which
is not recommended) then you're going to have to deal with security issues
such as needing a valid user account.  

Signature

I hope this helps,
Steve C. Orr
MCSD, MVP
http://Steve.Orr.net

> Btw, I got the following error when I tried to open my word document:
>
[quoted text clipped - 19 lines]
> >
> > Thanks in advance.
sweetpotatop@yahoo.com - 15 Feb 2006 14:30 GMT
I prefer not doing that way, that's why I wonder if I can do it through
xml. However, my original template is in Word. With grids, bookmarks. I
convert it into xml, however, how can I populate the bookmarks with
data in aspnet and push to the browser of the client?

Any quick and easy way please? All I want is to populate my Word
template and show to my client!

Thanks in advance. Your help would be greatly appreciated.

> If you're going to attempt COM Interop with Office on the web server (which
> is not recommended) then you're going to have to deal with security issues
[quoted text clipped - 29 lines]
> > >
> > > Thanks in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.