$PBExportHeader$w_main.srw forward global type w_main from window end type type cb_save_cust from commandbutton within w_main end type type dw_department from datawindow within w_main end type type cb_save_both from commandbutton within w_main end type type dw_customer from datawindow within w_main end type type cb_cancel from commandbutton within w_main end type end forward global type w_main from window integer width = 3561 integer height = 2100 boolean titlebar = true string title = "GhostScript" boolean controlmenu = true long backcolor = 67108864 string icon = "AppIcon!" boolean righttoleft = true boolean center = true cb_save_cust cb_save_cust dw_department dw_department cb_save_both cb_save_both dw_customer dw_customer cb_cancel cb_cancel end type global w_main w_main type prototypes end prototypes type variables end variables on w_main.create this.cb_save_cust=create cb_save_cust this.dw_department=create dw_department this.cb_save_both=create cb_save_both this.dw_customer=create dw_customer this.cb_cancel=create cb_cancel this.Control[]={this.cb_save_cust,& this.dw_department,& this.cb_save_both,& this.dw_customer,& this.cb_cancel} end on on w_main.destroy destroy(this.cb_save_cust) destroy(this.dw_department) destroy(this.cb_save_both) destroy(this.dw_customer) destroy(this.cb_cancel) end on type cb_save_cust from commandbutton within w_main integer x = 805 integer y = 1792 integer width = 663 integer height = 164 integer taborder = 30 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" string text = "Save Customer To PDF" end type event clicked;n_cst_ghostscript ln_gs String ls_CurrentDir, ls_PDFName ls_CurrentDir = GetCurrentDirectory() ls_PDFName = ls_CurrentDir + "\CustomerReport.pdf" If ln_gs.of_SaveAsPDF(dw_customer, ls_PDFName) Then If FileExists(ls_PDFName) Then // open the file ln_gs.of_ShellRun(ls_PDFName, "open", ln_gs.SW_SHOWNORMAL) End If Else MessageBox(this.Text, "PDF File Save Failed!~r~n~r~n" + Error.Text) End If end event type dw_department from datawindow within w_main integer x = 73 integer y = 64 integer width = 3406 integer height = 776 integer taborder = 10 string title = "none" string dataobject = "d_department" boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rowfocuschanged;this.SelectRow(0, False) this.SelectRow(currentrow, True) end event type cb_save_both from commandbutton within w_main integer x = 73 integer y = 1792 integer width = 663 integer height = 164 integer taborder = 30 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" string text = "Save Both To Same PDF" end type event clicked;n_cst_ghostscript ln_gs DataWindow ldw_Reports[] String ls_CurrentDir, ls_PDFName ls_CurrentDir = GetCurrentDirectory() ls_PDFName = ls_CurrentDir + "\CombinedReport.pdf" ldw_Reports[1] = dw_department ldw_Reports[2] = dw_customer If ln_gs.of_SaveAsPDF(ldw_Reports, ls_PDFName) Then If FileExists(ls_PDFName) Then // open the file ln_gs.of_ShellRun(ls_PDFName, "open", ln_gs.SW_SHOWNORMAL) End If Else MessageBox(this.Text, "PDF File Save Failed!~r~n~r~n" + Error.Text) End If end event type dw_customer from datawindow within w_main integer x = 73 integer y = 924 integer width = 3406 integer height = 776 integer taborder = 20 string title = "none" string dataobject = "d_customer" boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rowfocuschanged;this.SelectRow(0, False) this.SelectRow(currentrow, True) end event type cb_cancel from commandbutton within w_main integer x = 2926 integer y = 1792 integer width = 553 integer height = 164 integer taborder = 40 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" string text = "Cancel" boolean cancel = true end type event clicked;Close(Parent) end event
- Sources
- TopWiz
- ghostscript
- PB105
- w_main.srw
File: w_main.srw
Size: 4372
Date: Sat, 27 Jan 2024 02:08:56 +0100
Size: 4372
Date: Sat, 27 Jan 2024 02:08:56 +0100
- window w_main(srw)
- commandbutton cb_save_cust
- datawindow dw_department
- commandbutton cb_save_both
- datawindow dw_customer
- commandbutton cb_cancel