一个关于打印预览的问题

来源:互联网 发布:527轻会议软件 编辑:程序博客网 时间:2024/05/19 18:44

我做的打印预览程序,在Windows2000下一切均运行正常,但是在Windows XP上,出现如下问题:

1:交叉报表打印预览时,中间数据列部分,合计列部分均显示为0;2:两个主明细子数据窗口嵌套打印预览时数量,金额合计显示为0。

我的问题请各位高手多多指教,谢谢!

具体打印预览程序代码如下,还请各位高手多多指教:


调用方法:
openwithparm(w_dw_print_preview,dw_print)

w_dw_print_preview的open事件:


blob lblb_data

idw_data = message.powerobjectparm

dw_print.create( idw_data.describe("datawindow.syntax"))

idw_data.getfullstate( lblb_data )

dw_print.setfullstate( lblb_data )

dw_print.sort( )
dw_print.groupcalc( )

dw_print.Event ue_sharechild( )
dw_print.modify("datawindow.print.preview=yes datawindow.print.preview.rulers=yes")

post event ue_set_page( )

this.title = dw_print.describe('datawindow.print.documentname')+'预览'

ddlb_pre.text = '100%'
em_1.Text = '100'

If dw_print.RowCount () = 0 Then    //不可打印
 pb_printer.Enabled = False
 cb_first.Enabled = False
 cb_last.Enabled = False
 cb_prior.Enabled = False
 cb_next.Enabled = False
Else             //可以打印
 pb_printer.Enabled = True
 cb_first.Enabled = True
 cb_last.Enabled = True
 cb_prior.Enabled = True
 cb_next.Enabled = True
End If

inv_resize = create pfc_n_cst_resize
inv_resize.of_SetOrigSize (this.WorkSpaceWidth(), this.WorkSpaceHeight())
This.inv_resize.of_register(dw_print, 0, 0, 100, 100)

dw_print的ue_sharechild事件:

long ll_col, ll_colcount
String ls_colname,ls_dddwname

datawindowchild ldw_child
datastore lds_data

ll_colcount = Long( This.Describe("DataWindow.Column.Count"))

If ll_colcount > 0 Then
 For ll_col = 1 To ll_colcount
  
  If This.Describe("#" + String(ll_col) + ".edit.style") = 'dddw' Then
   ls_colname  = This.Describe("#" + String(ll_col) + ".name")
   ls_dddwname = This.Describe("#" + String(ll_col) + ".dddw.name")
   This.GetChild( ls_colname, ldw_child )
  End If
 Next
End If

w_dw_print_preview中的ue_set_page事件:

integer li_current_page
string ls_row

ls_row = string(dw_print.Object.Datawindow.FirstRowOnPage)

ii_pagecount = integer(dw_print.describe("evaluate('pagecount()',1)"))
li_current_page = integer(dw_print.describe("evaluate('page()',"+ls_row+")"))

em_page.Text = String( li_current_page ) + "/" + String( ii_pagecount )

原创粉丝点击