473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Word template to be filled by the server in aspnet

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.

Feb 13 '06 #1
9 1413
You need to be more specific in 'exactly' what you are trying to acheive.

--
Terry Burns
http://TrainingOn.net
<sw**********@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
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.

Feb 13 '06 #2
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.

Terry Burns wrote:
You need to be more specific in 'exactly' what you are trying to achieve.

--
Terry Burns
http://TrainingOn.net
<sw**********@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
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.


Feb 13 '06 #3
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.

--
Terry Burns
http://TrainingOn.net
<sw**********@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
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.

Terry Burns wrote:
You need to be more specific in 'exactly' what you are trying to achieve.

--
Terry Burns
http://TrainingOn.net
<sw**********@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
> 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.
>

Feb 13 '06 #4
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

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

"sw**********@yahoo.com" wrote:
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.

Feb 13 '06 #5
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!
Terry Burns wrote:
You need to be more specific in 'exactly' what you are trying to acheive.

--
Terry Burns
http://TrainingOn.net
<sw**********@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
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.


Feb 14 '06 #6
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.

Feb 14 '06 #7
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.

sw**********@yahoo.com wrote:
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.


Feb 14 '06 #8
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.

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

"sw**********@yahoo.com" wrote:
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.

sw**********@yahoo.com wrote:
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.


Feb 14 '06 #9
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.
Steve C. Orr wrote:
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.

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

"sw**********@yahoo.com" wrote:
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.

sw**********@yahoo.com wrote:
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.



Feb 15 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
3
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
0
by: royan | last post by:
Help please! I have the same problem which this post ...
6
by: royan | last post by:
Help please! I have the same problem which this post ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.