Visual Basic : Sending newline to Crystal Report

วิธีส่งข้อมูลที่มีการ enter (vbNewLine) ไปให้ Formulas ของ Crystal Report ทำได้โดย ใส่เครื่องหมาย chr(34) (qoute) คร่อม chr(10) (Line Feed) ไปอีกที ดังนี้

1
CrysRpt.Formulas(0) = "FormulaName=" & Chr(34) & Replace$(txtName.Text, vbNewLine, Chr(34) & " & Chr(10) & " & Chr(34)) & Chr(34)

ถ้าข้อมูล คือ

บรรทัดที่ 1
บรรทัดที่ 2

พอใช้คำสั่งแล้ว ข้อมูลที่จะส่งไปก็จะเป็น

FormulaName=”บรรทัดที่ 1″ & Chr(10) & “บรรทัดที่ 2″


Written by Komkid on October 19th, 2009 with no comments.
Read more articles on Programming.

Related articles

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:

You have to be identified to write a comment.