将数据放在打开的表单上的列中

编程入门 行业动态 更新时间:2024-10-28 06:24:16
本文介绍了将数据放在打开的表单上的列中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好。 我从数据库输入,其中包含描述和货币金额。 我必须将这些描述和金额放入电子邮件(或NotePad类型表)的列中,我会疯狂地试图获得金额排队。 描述可能是EG: aaaaaaaaaa AAAAAAAAAA 和金额分别为99.99和120.55。请注意,每个描述中有10个。 如果我使用类似的东西:

theString =说明& - &金额

循环然后我最终得到的列不对齐如下: aaaaaaaaaa - 99.99 AAAAAAAAAA - 120.55 使用.Length属性是没有意义的,因为两个描述字符串的长度都是10个字符。 有人可以建议我怎么做。 我尝试过使用padding和FixedLength但是没有用。 我有也尝试使用制表符(Chr(9)),但这也不起作用,因为描述的长度是相同的。

解决方案

只有两种方法行事情: 1)你需要指定字体:你需要一个非比例字体 - 这意味着所有字符都是相同的宽度。所以i与W相同。 Courier是一个不错的选择,它适用于大多数系统。 2)你需要能够以非字符增量指定标签点:像素,或者毫米。这更难,因为它取决于应用程序。 我?我会使用Courier! 其HTML将是:

正常< span > < FONT FACE = Courier New > Courier < / span >

感谢您的澄清。 如果电子邮件客户端支持html格式,请将数据放在html(table)标签之间:

< table > <! - 标题 - > < tr > < th > 说明< / th > < ; th > 金额< / th > < / tr > <! - 行 - > < tr > < td > AAAAAAAA < / td > < td > 99 < / td > < / tr > < tr > < ; td > aaaaaaa & / td > < td > 126 < / td > < / tr > < / table >

结果:

描述 量
AAAAAAAA 99
AAAAAAA 126

Hi again everyone. I have input from a database which consists of a Description and a currency Amount. I have to put these descriptions and amounts into an email (or NotePad type sheet) in columns and I am going crazy trying to get the amounts to line up. The descriptions may be EG: aaaaaaaaaa AAAAAAAAAA and the amounts 99.99 and 120.55 respectively. Note that there are 10 a's in each description. if I use something like :

theString = Description & " - " & Amount

in a loop then I end up with columns that are not aligned like: aaaaaaaaaa - 99.99 AAAAAAAAAA - 120.55 Using the .Length attribute is pointless because both Description strings are 10 characters in length. Could someone please suggest how I could do this. I have tried using padding and FixedLength but to no avail. I have also tried using tabs (Chr(9)) but that also does not work because the lengths of Description are the same.

解决方案

There are only two ways to "line things up": 1) You need to specify the font: you need a "non-proportional" font - which means all teh characters are the same width. So "i" is the same as "W". Courier is a good choice, and it's on most systems. 2) You need to be able to specify tab points in non-character increments: pixels perhaps, or millimeters. This is harder, as it depends on teh application. Me? I'd use Courier! The HTML for that would be:

Normal <span><FONT FACE= "Courier New">Courier</span>

Thank you for clarification. If email client supports html format, put the data between html (table) tags:

<table> <!-- headers --> <tr><th>Description</th><th>Amount</th></tr> <!-- rows --> <tr><td>AAAAAAAA</td><td>99</td></tr> <tr><td>aaaaaaa</td><td>126</td></tr> </table>

Result:

DescriptionAmount
AAAAAAAA99
aaaaaaa126

更多推荐

将数据放在打开的表单上的列中

本文发布于:2023-10-24 09:57:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1523643.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:放在   表单   数据

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!