| Skype: | TextControlSupport | |
| Orders: | 877-462-4772 |

A common office application is to write quotations for customers. Often these quotations are faxed or sent by e-mail. This demonstration illustrates some of TX Text Control Server's more advanced features by allowing a quotation to be created on the server and sent to the web browser client as a PDF. This demo requires Adobe Reader (free download) to be installed.
The following is not the entire source code to this sample application, just the parts in which TX Text Control ActiveX Server is called. To see the entire source code, please download the ASP project files (see link above).
' Load a template file tx.Load Server.MapPath("template.tx") [...] ' Fill the table with the entries from the form in a loop TotalSum = 0 TableID = 13 CurrentRow = 2 For i = 1 To request.form("article_amount") If(request.form("article" + CStr(i) + "_qty") <> 0) Then tx.SelStart = tx.TableCellStart(TableID, tx.TableRows(TableID)_ , 1) tx.TableInsertLines 2, 1 tx.TableCellText(TableID, CurrentRow, 1) = request.form_ ("article" + CStr(i) + "_qty") tx.TableCellText(TableID, CurrentRow, 2) = request.form_ ("article" + CStr(i) + "_ordernumber") tx.TableCellText(TableID, CurrentRow, 3) = request.form_ ("article" + CStr(i) + "_description") article_sum = request.form("article" + CStr(i) +"_qty")_ * request.form("article" + CStr(i) + "_price") TotalSum = TotalSum + article_sum tx.TableCellText(TableID, CurrentRow, 4) = FormatNumber_ (article_sum, 2) & " US $" CurrentRow = CurrentRow + 1 End If Next [...] ' Write the contents as a PDF document to a variable and return ' it to the client OutputBuffer = tx.SaveToMemoryBuffer(OutputBuffer, 12, 0) Response.Clear Response.ContentType = "application/pdf" Response.AddHeader "Content-Disposition", "attachment;_ filename=order.pdf" Response.BinaryWrite(OutputBuffer)
We would be delighted to assist you with this or any other TX Text Control ActiveX Server demonstration program. Please contact the Support Department.