情况如下:财务报表,要求及其严格。要求字符串长度超过(定数)自动换行
。而且在Detail带末的横线不画。对应数据对齐换行后。
例如:
----------------------------------------------------------
姓名 年龄 性别 职业
-------------------------------------------------------------
王平 20 男 工程师
-------------------------------------------------------------
乌鲁木齐家而林
不按时地方立刻
撒反 24 男 工程师
-------------------------------------------------------------
路平 ...... ......
-------------------------------------------------------------......
。而且在Detail带末的横线不画。对应数据对齐换行后。
例如:
----------------------------------------------------------
姓名 年龄 性别 职业
-------------------------------------------------------------
王平 20 男 工程师
-------------------------------------------------------------
乌鲁木齐家而林
不按时地方立刻
撒反 24 男 工程师
-------------------------------------------------------------
路平 ...... ......
-------------------------------------------------------------......
解决方案 »
- 进入fastreport 报表设计时字体乱码!
- 获取cbb的总项目个数是哪个属性?
- 下周今天是俺姐姐的生日,提前祝福姐姐生日快乐~~~~~~~~
- 如何得到一窗体或者是Frame上的画面?或者说怎么把某一窗体或者Frame上的内容截屏?
- 文本编辑与显示,关于电子病历...
- 提取字符串的问题
- Delphi中有没有类似于VB中DoEvents的东西?
- FieldByName和FieldValues.
- 谁有软件需求、总体设计和详细设计的标准文档模板(符合CMM体系),分数多多
- 如何在添加/删除程序中去掉已安装的程序名但不是真正的删除它程序本身
- 请问Formula One 是做报表的吗?来者有分!!!!
- 程序运行时如何在TTable中动态添加计算字段?
加入 #13#10
function WrapTexts(const Line, BreakStr: string; const BreakChars: TSysCharSet;
MaxCol: Integer): string;
const
QuoteChars = ['''', '"'];
var
Col, Pos: Integer;
LinePos, LineLen: Integer;
BreakLen, BreakPos: Integer;
QuoteChar, CurChar: Char;
ExistingBreak: Boolean;
L: Integer;
begin
Col := 1;
Pos := 1;
LinePos := 1;
BreakPos := 0;
QuoteChar := ' ';
ExistingBreak := False;
LineLen := Length(Line);
BreakLen := Length(BreakStr);
Result := '';
while Pos <= LineLen do
begin
CurChar := Line[Pos];
if CurChar in LeadBytes then
begin
L := CharLength(Line, Pos) - 1;
Inc(Pos, L);
Inc(Col, L);
if Col>=MaxCol then
BreakPos:=Pos;
end
else
begin
if CurChar = BreakStr[1] then
begin
if QuoteChar = ' ' then
begin
ExistingBreak := CompareText(BreakStr, Copy(Line, Pos, BreakLen)) = 0;
if ExistingBreak then
begin
Inc(Pos, BreakLen-1);
BreakPos := Pos;
end;
end
end
else if CurChar in BreakChars then
begin
if QuoteChar = ' ' then BreakPos := Pos
end
else if CurChar in QuoteChars then
begin
if CurChar = QuoteChar then
QuoteChar := ' '
else if QuoteChar = ' ' then
QuoteChar := CurChar;
end;
end;
Inc(Pos);
Inc(Col);
if not (QuoteChar in QuoteChars) and (ExistingBreak or
((Col > MaxCol) and (BreakPos > LinePos))) then
begin
Col := Pos - BreakPos;
Result := Result + Copy(Line, LinePos, BreakPos - LinePos + 1);
if not (CurChar in QuoteChars) then
while Pos <= LineLen do
begin
if Line[Pos] in BreakChars then
Inc(Pos)
else if Copy(Line, Pos, Length(sLineBreak)) = sLineBreak then
Inc(Pos, Length(sLineBreak))
else
break;
end;
if not ExistingBreak and (Pos < LineLen) then
Result := Result + BreakStr;
Inc(BreakPos);
LinePos := BreakPos;
ExistingBreak := False;
end;
end;
Result := Result + Copy(Line, LinePos, MaxInt);
end;
我应该在QuickRep中哪里做这种判断呢?OnfirstPage??
或者是其他的什么地方还是什么公式中??
请高手指点,分数不是问题。
,然后格子是画的假的。现在的问题是如果数据不换行的话,将会冒出格子
,如果换行的话,我需要怎么写这个判断条件呢?您刚才给出的是返回换行后的字符串,我该如何付给那个dbtext呢?
把quickrep 连到Table 或者Query 中
数据是自动显示的啊。