I have a Word application that does the following to retrieve data from the database
1) Run a JSP page that queries data from the database and formats the output into an HTML table/XML documen
2) The output is copied and pasted into open word document as output.
My question is, is it more optimum to use this method of querying using JSP page or is it better to use ADO from Word itself to query the data? Also, is it better to do the formatting in JSP or in Word? In JSP, I format the data and it is sent back to Word as an HTML table. Then it is just copied and pasted onto the Word document. So, in Word, it becomes a Word table instead of HTML table. Actually my application generates about 20 different Word tables like this and puts in the word document. What I want to know is
a) Is ADO faster than a JSP query
b) Is it faster to copy output from a HTML page and paste it onto Word? Does Word do any re-formatting to the document once it is copied?
Thank
Alex
JSP is going to have to get at the database via ADO or some such technology.
In effect, the JSP is just adding another layer of code between the database
and your end result. Why not cut out the middleman, and do it from inside a
Word macro instead?
Pasting an HTML table in Word is a but ugly, because Word preserves all
sorts of features used in HTML tables that are not needed in a Word table.
Frankly, I think it would be faster (and I know it would be much cleaner) to
do something like:
(instantiate an ADO recordset called loMyRecordset and populate it)
Set loTable = ActiveDocument.Tables(1)
with loMyRecordset
while not .eof
loTable.Rows.Add
With loTable.Rows(loTable.Rows.Count)
.Cells(1).Range.Text = loMyRecordset.Fields("OneField").Value
.Cells(2).Range.Text =
loMyRecordset.Fields("AnotherField").Value
.Cells(3).Range.Text =
loMyRecordset.Fields("YetAnotherField").Value
...
End With
.movenext
wend
end with
> I have a Word application that does the following to retrieve data from the database:
> 1) Run a JSP page that queries data from the database and formats the output into an HTML table/XML document
> 2) The output is copied and pasted into open word document as output.
>
> My question is, is it more optimum to use this method of querying using JSP page or is it better to use ADO from Word itself to query the data?
Also, is it better to do the formatting in JSP or in Word? In JSP, I format
the data and it is sent back to Word as an HTML table. Then it is just
copied and pasted onto the Word document. So, in Word, it becomes a Word
table instead of HTML table. Actually my application generates about 20
different Word tables like this and puts in the word document. What I want
to know is:
> a) Is ADO faster than a JSP query?
> b) Is it faster to copy output from a HTML page and paste it onto Word? Does Word do any re-formatting to the document once it is copied?
>
> Thanks
> Alex