I want to create a Word document that will display data from a database. I
don't want to create the file on the server, I just want to stream it out
directly to the user. When they click a button, the Word Save Open window
will open, and allow the user to Save or Open the document in Word. I know I
need to use response.binary write, but I don't know if it is possible to
create the binary object without first saving it to a temporary file. Would
I need to create a Word template, and how would I use it?
How would I get data from a data grid into this document? 3 1911
Hi Leonard...
There IS a possibility of doing what you want with the most recents
versions of Word (i.e. from Office XP and above), but it has no
backwards compatibility.
You CAN simple set the ResponseType to "applicatio n/word" and send an
XML document that mimics the Word new XML document file type.
Just create a new document and save as an XML file and see the output.
Regards,
Paulo
Hi Paulo,
Does that mean I still have to create a file, enen if it is temporary? I
would create the file on my app server, and then use ResponseType
application/word to send it to the user, so the user would not need the
latest version, correct? So, I would need to create the word document, using
xml, and some text, but couldn't I just save to a .doc file?
"MstrContro l" wrote: Hi Leonard...
There IS a possibility of doing what you want with the most recents versions of Word (i.e. from Office XP and above), but it has no backwards compatibility.
You CAN simple set the ResponseType to "applicatio n/word" and send an XML document that mimics the Word new XML document file type.
Just create a new document and save as an XML file and see the output.
Regards,
Paulo
You shouldn't have to create a temp file on the server side, some sites
do this for various reasons, but as long as you can create the file in
a file object of some kind (or even just store the file contents in a
variable), then you can stream the download to the requesting user.
Things to look at for this:
Dim fileName, fileContents
fileName = "myfile.doc "
fileContents = someFileContent sString
Response.Conten tType = "applicatio n/word"
Response.AddHea der "content-disposition", "attachment ; filename=" &
fileName
Response.Write fileContents
Response.End
We have this grouped in a procedure where we just pass in the filename
and the filecontents, you could expand to include the filetype to make
it more generic. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Kerri McDonald |
last post by:
We have an application where the user fills out many screens and when
they are done, we are supposed to display the text they entered in a
word or excel format. That is fairly easily accomplished by changing
the content type in the response object.
On one of the screens where they enter data, they also have the
ability to upload a word document containing additional information.
This is also not a problem, and is working fine.
Now they...
|
by: Eric |
last post by:
How can I dynamically assign an event to an element?
I have tried :
(myelement is a text input)
document.getElementById('myelement').onKeyUp =
"myfnc(param1,param2,param3)";
document.getElementById('myelement') = new
Function("myfnc(param1,param2,param3)");
|
by: Michelle |
last post by:
I have a div that is initially empty. Clicking on a button will add some
text boxes and other controls so the user can add additional records. In
IE
all works fine but in Netscape 7.0 when I add another "record" the values
for all previous controls within the div are wiped out. In the javascript
function where I add on to the html in the div if I capture all the data in
the previous "records" then after adding the new record I can...
|
by: KnotKnormal |
last post by:
I would like to dynamically load a HTML page (or a Word document), which is embedded in a table when the user clicks on a hyperlink to go from HTML page one to HTML page two. For example, I would like the secretary at a school to update a Word document concerning homework assignments. This Word document would reside on the server. When changes are made it, these changes are automatically updated to the web page. This would simplify life...
|
by: m3ckon |
last post by:
Hi there,
I can succesfully create a word doc from my asp.net page, but I have 2
issues I need to resolve in order to use it in my app:
1) Creating a table: I seem unable to create a table, I'm uing the coe
below, but I'm unsure as to what the Range parameter should be for
oWordDoc.Content.Tables.Add ???
| |
by: Leonard |
last post by:
I want to create a Word document that will display data from a database. I
don't want to create the file on the server, I just want to stream it out
directly to the user. When they click a button, the Word Save Open window
will open, and allow the user to Save or Open the document in Word. I know I
need to use response.binarywrite, but I don't know if it is possible to
create the binary object without first saving it to a temporary file....
|
by: stellstarin |
last post by:
I have a html where fields are created and added dynamically on the
client side. I use the
AppendChild() call to create fields dynamically.
On submit i try to get the value for all the elements in the form,
including those that are added
dynamically. I use document.getElementsByName('Field Name')to achieve
the same.
|
by: PracticalApps |
last post by:
I looked to find a canned solution to create a Word document in my application and just couldn't find anything that just gets to the point. I would think, and I may be making too strong of an assumption here, that anyone looking for this kind of solution would just want a simple example that they can work from and expand upon.
In my case, I just want to output a new Word document. I found that creating a simple wrapper class would make this...
|
by: moksha |
last post by:
Hi,
I am new to javascript and i am facing a problem in coding.
plz help me out.
I am using javascript for dynamically creating a table row which contains text boxes and radio buttons and check box.
I am adding two radio buttons once for a row.Now my problem is the radio buttons in all the rows that added dynamically are behaving as same group i.e
when i am selecting a radio button in second row,radio button in first row...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |