关于F1BookNo.1:
procedure TF1BookFrn.Button8Click(Sender: TObject);
begin
//F1Book1.FormulaRC[nRow, nCol]:=
with F1Book1 do
begin
...;
FormulaRC[3,1] := 'A1 + A2';
{我要得到他们的值,而不是只写表达试,可以不用循环么手动的写?}
...
end;
end;
No.2:
F1Book还有加再什么东西?
如:
procedure TF1BookFrn.FormatCell(CellRow, CellCol: integer; CellWidth,
CellXiaoShu: string);
{var
f: F1CellFormat;//为什么不能通过?
i: integer;
NumberWidth, NumberXiaoShu: string; }
begin
{F1Book1.SetActiveCell(CellRow, CellCol);
F := F1Book1.GetCellFormat;
for i := 0 to strtoint(CellWidth) do
NumberWidth := NumberWidth + '#';
for i := 0 to strtoint(CellXiaoShu) do
NumberXiaoShu := NumberXiaoShu + '#';
if NumberXiaoShu <> '' then
NumberXiaoShu := '.' + NumberXiaoShu;
f.NumberFormat[F1Book1.Handle] := NumberWidth + NumberXiaoShu;
F1Book1.SetCellFormat(f); }
end;No.3 ,No.4,No.5:
求相关资料
procedure TF1BookFrn.Button8Click(Sender: TObject);
begin
//F1Book1.FormulaRC[nRow, nCol]:=
with F1Book1 do
begin
...;
FormulaRC[3,1] := 'A1 + A2';
{我要得到他们的值,而不是只写表达试,可以不用循环么手动的写?}
...
end;
end;
No.2:
F1Book还有加再什么东西?
如:
procedure TF1BookFrn.FormatCell(CellRow, CellCol: integer; CellWidth,
CellXiaoShu: string);
{var
f: F1CellFormat;//为什么不能通过?
i: integer;
NumberWidth, NumberXiaoShu: string; }
begin
{F1Book1.SetActiveCell(CellRow, CellCol);
F := F1Book1.GetCellFormat;
for i := 0 to strtoint(CellWidth) do
NumberWidth := NumberWidth + '#';
for i := 0 to strtoint(CellXiaoShu) do
NumberXiaoShu := NumberXiaoShu + '#';
if NumberXiaoShu <> '' then
NumberXiaoShu := '.' + NumberXiaoShu;
f.NumberFormat[F1Book1.Handle] := NumberWidth + NumberXiaoShu;
F1Book1.SetCellFormat(f); }
end;No.3 ,No.4,No.5:
求相关资料
听说UP有分。
帮你UP!
你多说说.........
No.1 ~~No.2的分给你
F1Book就是电子表格控件,类似Excel,但用起来不太方便。在设计时不能手工写,但运行状态可以手工写。
等我回去研究研究再说
现在已经选择了它,你随便的说一说她的用法好不好?等待,如沙漠行舟,痛苦万分
可惜,我没用过formula one等,主要考虑版权。难道大家就没有明白的?to楼主,分不重要,我经常来,却没精力回答问题。
F1Book 在Active页
{ f: F1CellFormat;//为什么不能通过?}中 F1CellFormat什莫东西?既然没有高手,我就多up两下吧!期待高手到来!
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, AxCtrls, OleCtrls, VCF1, DB, ADODB;type
TForm1 = class(TForm)
F1Book1: TF1Book;
BitBtn1: TBitBtn;
ADOQuery1: TADOQuery; //数据集
Edit1: TEdit; //表名编辑框
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.BitBtn1Click(Sender: TObject);
VAR
I,J: INTEGER;
begin
SHOWMESSAGE(trim(Edit1.Text)); //显示表名
with ADOQuery1 do //读取数据集
begin
close;
ADOQuery1.sql.clear;
sql.add('SELECT * FROM '+ TRIM(Edit1.Text));
open;
end;
//写f1Book的标题栏
FOR I:=0 TO ADOQuery1.FieldCount-1 DO
BEGIN
F1BOOK1.ColText[I+1]:=ADOQuery1.Fields[I].FieldName;
END;
J:=1;
//写内容
ADOQuery1.First;
WHILE NOT ADOQuery1.EOF DO
BEGIN
FOR I:=0 TO ADOQuery1.FieldCount-1 DO
BEGIN
F1BOOK1.TextRC[J,I+1]:=ADOQuery1.FIELDBYNAME(ADOQuery1.Fields[I].FieldName).ASSTRING;
END;
J:=J+1;
ADOQuery1.Next;
END;
end;
end.
再多的用法就不知道了
该段代码是不是用的F1BOOK版本比较高,而你的F1BOOK是DELPHI自带的,所以有此提示。
查查F1CellFormat在哪个PAS单元声明的,引用一下
各种资料赋值:
f1book1.textrc[row+4,1]:=Table1.fields[0].asSTRING;
f1book1.TextRC[2,2]:=datetostr(now);读入
f1book1.read(ExtractFileDir(paramstr(0))+'\f1book1.xls',F1FileExcel5);写入
f1book1.write(ExtractFileDir(paramstr(0))+'\SHHH.xls',F1FileExcel5);选择
F1book1.SetSelection(2,2,2,2);
F1book1.GetSelection(0,pRow1,pCol1,pRow2, pCol2); 合并
var
CellFormat: F1CellFormat;
begin
cellformat := F1Book1.GetCellFormat;
cellformat.MergeCells := true;
F1Book1.SetCellFormat(cellformat);
end;
尽管BORLAND帮助做的一贯不好但是解决这些问题还是绰绰有余的
谢谢。.
To things(平) (枕流以洗耳,漱石以磨牙)
我看了一下,windows 自己有一个vcf132.ocx的,但情况没有好转
是不是要倒入类型库?是哪个?
他的版本很多,里面的对象也不同。开发资料也不多。
3年前用vb用f1book开发了一个报表程序,现在忘的差不多,代码也找不到了,只能帮你up了
还是靠自己吧,哈哈哈哈哈哈哈哈哈
Formula One 6.1我一两年前就有了,而且我这里有一个别人做得vb程序。懒得看啊。
网上应该能搜到啊!
var
s:string;
cellformat:f1cellformat;
begin
cellformat:=fbook1.getcellformat;
s:=cellformat.NumberFormat[fbook1.handle];
if pos('.',s)<>0 then cellformat.NumberFormat[fbook1.handle]:=s+'0'
else
cellformat.NumberFormat[fbook1.handle]:='#.0';
fbook1.SetCellFormat(cellformat);
end;procedure TForm1.ToolButton33Click(Sender: TObject); //¼ÓСÊýµã
var
i:integer;
s,s2,s3,s4:string;
cellformat:f1cellformat;
begin
cellformat:=fbook1.getcellformat;
s:=cellformat.NumberFormat[fbook1.handle];
i:=length(s);
s2:=copy(s,1,pos('.',s)-1);
s3:=copy(s,pos('.',s),i-pos('.',s));
if s3<>'.' then
s4:=s2+s3
else
s4:=s2;
cellformat.NumberFormat[fbook1.handle]:=s4;
fbook1.SetCellFormat(cellformat);
end;procedure TForm1.ToolButton38Click(Sender: TObject);
var
r1,c1,r2,c2:integer;
begin
fbook1.getselection(0,r1,c1,r2,c2);
fbook1.ObjCreate(5,r1,c1,r2,c2);
fbook1.ObjBringToFront ;
end;
procedure TForm1.ToolButton39Click(Sender: TObject);
var
cellformat:f1cellformat;
s,s1:string;
i,j,r1,r2,c1,c2:integer;
cellvalue:double;
begin
s1:='#,###.';
fbook1.GetSelection(0,r1,c1,r2,c2);
cellvalue:=fbook1.numberrc[r1,c1];
cellformat:=fbook1.GetCellFormat;
s:=cellformat.NumberFormat[fbook1.handle];
if pos(',',s)<>0 then
begin
if pos('.',s)<>0 then cellformat.NumberFormat[fbook1.handle]:='###'+copy(s,pos('.',s),length(s)-pos('.',s)+1)
else
cellformat.NumberFormat[fbook1.handle]:='###';
end
else
begin
if s='General'then
begin
if pos('.',floattostr(cellvalue))=0 then cellformat.NumberFormat[fbook1.handle]:='#,###'
else
begin
i:=length(floattostr(cellvalue));
for j:=1 to i-pos('.',floattostr(cellvalue)) do
begin
s1:=s1+'0';
end;
cellformat.NumberFormat[fbook1.handle]:=s1;
end;
end
else
cellformat.NumberFormat[fbook1.handle]:='#,###'+copy(s,pos('.',s),length(s)-pos('.',s)+1);
end;
fbook1.SetCellFormat(cellformat);
end;
procedure TF1BookFrn.FormatCell(CellRow, CellCol: integer; CellWidth,
CellXiaoShu: string);
var
f: F1CellFormat;
i: integer;
NumberWidth, NumberXiaoShu: string; {}
begin
F1Book1.SetActiveCell(CellRow, CellCol);
F := F1Book1.GetCellFormat;
for i := 0 to strtoint(CellWidth) do
NumberWidth := NumberWidth + '#';
for i := 0 to strtoint(CellXiaoShu) do
NumberXiaoShu := NumberXiaoShu + '#';
if NumberXiaoShu <> '' then
NumberXiaoShu := '.' + NumberXiaoShu;
f.NumberFormat[F1Book1.Handle] := NumberWidth + NumberXiaoShu;
F1Book1.SetCellFormat(f); {}
end;procedure TF1BookFrn.Button2Click(Sender: TObject);
var
i,j: Byte;
aa: smallint;
strName:WideString;
//F1Book1: TF1Book;
begin
//F1Book1 := TF1Book.Create(self);
for i := 1 to 9 do
begin
for j := 1 to 9 do
begin
F1Book1.Row := i;
F1Book1.Col := j;
F1Book1.Text := IntToStr(i)+'×'+IntToStr(j)+'='+IntToStr(i*j);
end;
end;
F1Book1.FormulaRC[ir
{}
end;
F1Book1.FormulaRC[irow, icol] := strFormula; //设置该单元格的公式
F1Book1.SaveFileDlg('save',strname,aa);
F1Book1.Write(strname,aa);
ShellExecute(hwnd(nil), 'open',PChar(string(strName)),nil,nil, SW_MAXIMIZE);
F1Book1.Free;
end;