下载了反编译的中文报表服务组件,不知道怎么用?

richgod 2008-04-09 09:00:59
我下载了一个反编译的中文报表服务组件,(http://access911.net/CSDN/FileDescription.asp?mdb=2008-4-9&id=31),特别想做出那个例子六的承前页转下页的三栏式的财务样式,不知道如何才能把这一块单独摘下来,为自己的程序所用?源文件的mydll.dll及.ocx都是怎么用的?多谢了!
这是例子六三栏式财务窗口的open(),类似inv.Report,(dw_1.inv_Report.OF_GridToReport())都是怎么定义的,怎么才能提取出来用呢?
Date ld_rq
Double ld_j ,ld_d
Double ld_jlj, ld_dlj , ld_ye //借方累计 贷方累计 余额
Double ld_jlj_sum , ld_dlj_sum //本年借方累计 贷方累计


n_cst_DateTime n_datetime
Long li_Row,li

dw_1.OF_SetReport(True)


dw_1.Inv_Report.OF_SetReportTitle("三栏明细帐")
//dw_1.Inv_Report.OF_SetReportTitle(1,"l","='单位名称:'+F_CompanyName()")
dw_1.Inv_Report.OF_SetReportTitle(1,"l","单位名称:XXXXXXX公司")
dw_1.Inv_Report.OF_SetReportTitle(1,"m","月份:2002年1月至2月")
dw_1.Inv_Report.OF_SetReportTitle(1,"r","='页 码:'+Page()+'/'+PageCount() ")

dw_1.inv_Report.ib_AddUpDownRows=True
dw_1.inv_Report.is_UpDown_TextCol="zy"

dw_1.inv_Report.istr_UpDown_ValCols[1].ColName="j"
dw_1.inv_Report.istr_UpDown_ValCols[1].Condition1="month(rq)"
dw_1.inv_Report.istr_UpDown_ValCols[2].ColName="d"
dw_1.inv_Report.istr_UpDown_ValCols[2].Condition1="month(rq)"
dw_1.inv_Report.istr_UpDown_ValCols[3].ColName="ye"

dw_1.inv_Report.OF_GridToReport()

//设置货币列显示格式
dw_1.Inv_Report.OF_SetMoneyCols("j",10,True)
dw_1.Inv_Report.OF_SetMoneyCols("d",10,True)
dw_1.Inv_Report.OF_SetMoneyCols("ye",10,True)

////月/日列不允许用户调整宽度
//dw_1.Inv_Report.OF_SetResizeColumn("mon",False)
//dw_1.Inv_Report.OF_SetResizeColumn("day",False)


//显示金额单位
dw_1.Inv_Report.OF_SetMoneyCols("j_t",10,False)
dw_1.Inv_Report.OF_SetMoneyCols("d_t",10,False)
dw_1.Inv_Report.OF_SetMoneyCols("ye_t",10,False)

dw_1.inv_Report.OF_UpdateRequestor()




dw_1.Modify("zy.alignment='0~tif(flag=~"1~",2,0) ' ")
dw_1.Retrieve()
dw_1.SetFocus()

ld_rq=Date("2002-01-01") //开始日期
ld_ye=10000 //期初余额
ld_jlj_sum=0 //期初借方累计发生额
ld_dlj_sum=0 //期初贷方累计发生额


li_Row=dw_1.InsertRow(1)
dw_1.SetItem(li_Row,"rq",ld_rq)
dw_1.Modify("nf_t.Text='"+String(Year(ld_rq))+"年'")
IF Month(ld_rq)=1 Then
dw_1.SetItem(li_Row,"zy","年初余额")
ELSE
dw_1.SetItem(li_Row,"zy","上月余额")
END IF

dw_1.SetItem(li_Row,"flag","1")
dw_1.SetItem(li_Row,"ye",ld_ye)

//计算结余和本月小计

For li=2 TO dw_1.RowCount()
IF dw_1.Object.Flag[li]="1" Then
Continue
END IF


ld_j=is_nvll(dw_1.object.j[li],0)
ld_d=is_nvll(dw_1.object.d[li],0)

IF Month(Date(dw_1.Object.rq[li]))<>Month(ld_rq) Then

li_Row=dw_1.InsertRow(li) //插入一行
dw_1.SetItem(li_Row,"rq",n_dateTime.OF_LastDayOFMonth(ld_rq))
dw_1.SetItem(li_Row,"zy","本月小计")
dw_1.SetItem(li_Row,"flag","1")
dw_1.SetItem(li_Row,"j",ld_jlj)
dw_1.SetItem(li_Row,"d",ld_dlj)
dw_1.SetItem(li_Row,"ye",ld_ye)

ld_jlj=0
ld_dlj=0

li++
ld_rq=Date(dw_1.Object.rq[li])
END IF

ld_jlj+=ld_j //本月借方合计
ld_dlj+=ld_d
ld_jlj_sum+=ld_j //本年借方合计
ld_dlj_sum+=ld_d


ld_ye=ld_ye+ld_j - ld_d
dw_1.SetItem(li,"ye",ld_ye)

Next

li_Row=dw_1.InsertRow(li) //插入一行
dw_1.SetItem(li_Row,"rq",n_dateTime.OF_LastDayOFMonth(ld_rq))
dw_1.SetItem(li_Row,"zy","本月小计")
dw_1.SetItem(li_Row,"flag","1")
dw_1.SetItem(li_Row,"j",ld_jlj)
dw_1.SetItem(li_Row,"d",ld_dlj)
dw_1.SetItem(li_Row,"ye",abs(ld_ye))



li_Row=dw_1.InsertRow(0) //插入一行
dw_1.SetItem(li_Row,"rq",n_dateTime.OF_LastDayOFMonth(ld_rq))
dw_1.SetItem(li_Row,"zy","本年累计")
dw_1.SetItem(li_Row,"flag","1")
dw_1.SetItem(li_Row,"j",ld_jlj_sum)
dw_1.SetItem(li_Row,"d",ld_dlj_sum)
dw_1.SetItem(li_Row,"ye",ld_ye)




...全文
71 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
myvicy 2008-04-09
关注...
回复
相关推荐
发帖
PowerBuilder
创建于2007-09-28

866

社区成员

PowerBuilder 相关问题讨论
申请成为版主
帖子事件
创建了帖子
2008-04-09 09:00
社区公告
暂无公告