财务报表格式,求一修改报表格式的例程

求一修改报表格式的例程 - 故障解答 - 电脑教程网

求一修改报表格式的例程

日期:2007-01-08   荐:
求一修改报表格式的例程求一例程:用sqlca.syntaxfromsql动态创建的数据窗口,需要制作出表头,表尾,及中间明细资料的纵横线,知道可以用modify()实现,但做起来比较麻烦,不知那位大哥有这方面的例程,给学习一下,邮箱:[email protected] 谢了!这比较要命,还不如自己先生成 一个,然后看看里面的代码,什么都有了!这个帮你顶顶~~谢谢各位了,给个连接也好!可以先画好数据窗,导出为psr文件,再根据psr文件动态创建数据窗读取psr文件来创建动态数据窗样例:string ls_syntax,ls_error,ls_retls_ret = char(13) char(10) //回车键int li_fileNumlong li_lengthli_FileNum = FileOpen("efef.psr",Streammode!, read!, shared!, Replace!)// 以下是pb5的代码if li_filenum >0 then FileSeek(li_FileNum, 158, FromBeginning!) li_length = fileRead(li_filenum,ls_syntax)end iffileclose(li_filenum)if li_length = 0 then returnls_syntax = "release 5;" ls_ret ls_syntax //截掉ls_syntax中的数据部分,5.0以"sparse(names="dept_name?) "作为参考位置//6.0以html(作为参考位置long pos1,pos2pos1 = pos(ls_syntax,'sparse(names="',1)pos2 = pos(ls_syntax,'"',pos1 16)ls_syntax = left(ls_syntax,pos1) mid(ls_syntax,pos1 1,pos2 - pos1 1)dw_New.create(ls_syntax,ls_error)if ls_error <> '' then messagebox('Create Error',ls_error)else dw_new.settransobject(sqlca) dw_new.retrieve()end if或者由另一个已经画好的数据窗的syntax来创建string ls_syntax,ls_errorls_syntax = dw_test.describe('datawindow.syntax')dw_new.create(ls_syntax,ls_error)if ls_error <> '' then messagebox('Create Error',ls_error)else dw_new.settransobject(sqlca) dw_new.retrieve()end ifstring ERRORS, sql_syntaxstring presentation_str, dwsyntax_strsql_syntax = " SELECT precdate=pur10110.precdate," & "pono=pur10110.pono, " & " poseq=pur10110.poseq, " & "part=pur10110.part," & "unit=pur10110.unit, " & "prloc= pur10110.prloc," & "qty= pur10110.qty," & "rs= pur10110.rs, " & "pofact = coalesce(pur10110.pofact, 1)," & "vendor= pur10110.vendor," & "descshort=ven10100.descshort, " & "currency=pur10110.currency, " & "qty1 = coalesce(pur10110.qty, 0) - coalesce(inv80207.recqty, 0) coalesce(inv80207.rtnqty, 0) coalesce(inv80207.rejqty, 0), " & " remark= pur10115.remark," & "qcyn=inv10103.qcyn," & "qcyn1=inv10102.qcyn, " & "unprc=convert(decimal(14,4),pur10110.unprc)" & " FROM pur10110, " & " ven10100, " & " inv80207, " & " pur10115, " & " inv10103, " & " inv10102 " & "WHERE ( pur10110.pono *= pur10115.pono) and " & "( pur10110.poseq *= pur10115.poseq) and " & "( pur10110.pono *= inv80207.docno) and" & "( pur10110.poseq *= inv80207.docseq) and" & " ( pur10110.part *= inv10102.part) and" & "( pur10110.vendor *= inv10103.vendor) and " & "( pur10110.part *= inv10103.part) and " & " ( pur10110.potype <> 'F') and /*demon 2002.05.10*/" & "/* ( pur10110.currency = ven10100.currency ) and /*demon 2002.05.08*/*/" & " ( pur10110.vendor =ven10100.vendor ) and " & "(( pur10110.currency = '" ls_currency "') and" & " ( pur10110.vendor = '" ls_vendor "') AND" & "( pur10110.precdate >='" string(ldt_date) "') AND" & " ( pur10110.precdate <= '" string(ldt_date1) "' ) AND " & "( inv80207.filename = 'pur10110' ) AND" & " ( inv10103.vensub = 'V' ) AND " & "(pur10110.status = 'OP' OR " & " pur10110.status = 'IN') )" & " and ( pur10110.potype = 'O' )" &"ORDER BY pur10110.precdate ASC," & " pur10110.pono ASC," & " pur10110.poseq ASC "presentation_str = "style(type=grid)"dwsyntax_str = SQLCA.SyntaxFromSQL(sql_syntax, &presentation_str, ERRORS)IF Len(ERRORS) > 0 THENMessageBox("Caution", &"SyntaxFromSQL caused these errors: " ERRORS)RETURNEND IFids_pur.Create( dwsyntax_str, ERRORS)IF Len(ERRORS) > 0 THENMessageBox("Caution", &"Create cause these errors: " ERRORS)RETURNEND IFids_pur.settransobject(sqlca)ll_row = ids_pur.retrieve()
标签: