Skype:TextControlSupport
Orders:877-462-4772
TX Text Control - word processing components.

Create a web store quotation

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.

Selective source code from demonstration application

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).

  1. ' Load a template file
  2. tx.Load Server.MapPath("template.tx")
  3.  
  4. [...]
  5.  
  6. ' Fill the table with the entries from the form in a loop
  7. TotalSum = 0
  8. TableID = 13
  9. CurrentRow = 2
  10.  
  11. For i = 1 To request.form("article_amount")
  12. If(request.form("article" + CStr(i) + "_qty") <> 0) Then
  13. tx.SelStart = tx.TableCellStart(TableID, tx.TableRows(TableID)_
  14. , 1)
  15. tx.TableInsertLines 2, 1
  16. tx.TableCellText(TableID, CurrentRow, 1) = request.form_
  17. ("article" + CStr(i) + "_qty")
  18. tx.TableCellText(TableID, CurrentRow, 2) = request.form_
  19. ("article" + CStr(i) + "_ordernumber")
  20. tx.TableCellText(TableID, CurrentRow, 3) = request.form_
  21. ("article" + CStr(i) + "_description")
  22. article_sum = request.form("article" + CStr(i) +"_qty")_
  23. * request.form("article" + CStr(i) + "_price")
  24. TotalSum = TotalSum + article_sum
  25. tx.TableCellText(TableID, CurrentRow, 4) = FormatNumber_
  26. (article_sum, 2) & " US $"
  27. CurrentRow = CurrentRow + 1
  28. End If
  29. Next
  30.  
  31. [...]
  32.  
  33. ' Write the contents as a PDF document to a variable and return
  34. ' it to the client
  35. OutputBuffer = tx.SaveToMemoryBuffer(OutputBuffer, 12, 0)
  36.  
  37. Response.Clear
  38. Response.ContentType = "application/pdf"
  39. Response.AddHeader "Content-Disposition", "attachment;_
  40. filename=order.pdf"
  41. Response.BinaryWrite(OutputBuffer)

Need help?

We would be delighted to assist you with this or any other TX Text Control ActiveX Server demonstration program. Please contact the Support Department.

top

Top 10 Bestselling Product Award 2007Top 25 Publisher Product Award 2007Top 10 Bestselling Product Award 2007 in JapanTop 25 Bestselling Product Award 2006Top 25 Bestselling Publisher Award 2006Reader's Choice Award, dot.net magazin, 3rd place