Hi,
After some time tested, Ah, FastReport,The most best report engine for FWH,Harbour!
1.(1)in develop only need fastreph.prg (2200 lines),fastReph.ch, Frsysth.dll (3.6M).
(2)in client app.exe only need Frsysth.dll (lang.xml optional), include print,preview,export to jpg,email etc and visual designer for form .fr3 file.
2.You only need prepare your databse datas often as dbf alias, tmysql self defined data, Others only need is to design froms as xx.fr3 file !
examples:
in prg :
FrPrn := frReportManager():new()
FrPrn:LoadLangRes("chinese.xml")
odbprn0:=oserver:query("select * from ...")
odbprn1:=oserver:query("select * from ...")
odbprn2:=oserver:query("select * from ...")
//FrPrn:SetWorkArea(<cFrAlias>, <nWorkArea>, [<lOem>], [<aRangeParams>])
FrPrn:SetUserDataSet("our",mysqlfields(odbprn0),;
{|| odbprn0:GoTop()} ,;
{|| odbprn0:SKIP(1)},;
{|| odbprn0:SKIP(-1) },;
{|| odbprn0:EOF() },;
{|aField|odbprn0:FIELDGET(afield)})
FrPrn:SetUserDataSet("title",mysqlfields(odbprn1),;
{|| odbprn1:GoTop()} ,;
{|| odbprn1:SKIP(1)},;
{|| odbprn1:SKIP(-1) },;
{|| odbprn1:EOF() },;
{|aField|odbprn1:FIELDGET(afield)})
// one or more browse like table .
FrPrn:SetUserDataSet("masterdata",mysqlfields(odbprn2),;
{|| odbprn2:GoTop()} ,;
{|| odbprn2:SKIP(1)},;
{|| odbprn2:SKIP(-1) },;
{|| odbprn2:EOF() },;
{|aField|odbprn2:FIELDGET(afield)})
FrPrn:LoadFromString(odbprn13:cvalue) // saved .fr3 from mysqldatabase blob field
//or FrPrn:LoadFromFile(RepDir + "1.fr3")
do case
case lpreview==nil
FrPrn:designReport()
// This enter design .fr3 form file !
if msgyesno("Save ?","")
if LEN(ALLTRIM(oserver:querydata("select id from fr3 where id='"+cid1+"'")))==0
oserver:query("insert into fr3 (id,cvalue) values ('"+cid1+"',' ')")
end
oserver:query("update fr3 set cvalue='"+mysqleascape(frprn:SaveToString())+"' where id='"+cid1+"'")
// or save to file FrPrn:SaveToFile(<cFileName>)
end
case lpreview==.t.
FrPrn:showReport()
case lpreview==.f.
FrPrn:SetProperty("Report", "ShowProgress", .f.)
FrPrn:PrepareReport()
FrPrn:Print(.t.)
FrPrn:SetProperty("Report", "ShowProgress", .t.)
end
FrPrn:DestroyFR()
odbprn0:end()
3. .fr3 with title,header,masterdata,footer,page footer,...
4.In .fr3 could call harbour/fwh private vars,harbour/fwh functions
parament as SQL like, string type write as 'aaa' or "'a"+var1+"'"
(1)GetHbVar('MyVar')
(2)callhbfunc('functionname',[para1,para2,...]) , example callfunc('alltrim',['001 ']) --> '001'
(3)GetHbArrayVar('MyArray', [6]) -> MyArray[6]
(4)EvalMacro('var1) --> &var1
5. print page 1/3 ,2/3, 3/3 , in .fr3 [#page]['/'][#totalpage]
6. Auto split too long text colum into 2,3,... lines
in .fr3,(1)masterdata1AllowSplit Y,Strethed Y, (2)masterdata exvery cell StresMode Y
Line____name_____addrs________________birthday
=======================================
line1___name1____local 3_______________12/12/1971
line2___name2____No323,3'rd Street,_____07/02/1981
________________Orr city, xx Province,____________
________________XXX Counrty___________________
line3___name3____xx Univer_____________05/12/1968
//__ as space
7. in .fr3
['txt1']
[ masterdata->qty]
[round(<masterdata."qty">*<masterdata."unitpri">*(1-<title."disount">/100),2)]
[sum(<masterdata->qty>)]
format can be 12,151.50, 12151.5, $12151 ,...
text frame can be | _ | - [] space
Text, Line, Diagonal line, Picture, Shape, OLE, RichText, Chart
Barcode etc.
8. self define page len,width
9 .Can export into PDF,HTML, RTF ,CSV, XLS,DotMatrix, BMP, JPEG, TXT,TIFF, GIF, SimpleText, Mail,XML, ODS, ODT
on preview or call Frprn:DoExport(<cExportObjectName>)
...
Best Regards !
Shuming Wang