Schultz’s PowerBuilder Notes

Migrating PB9 Objects to PB7


You may find yourself working in PB 7 and wanting to use a DataWindow developed in PB 9.  Some objects are easier than others.

 DataWindows

Datawindows are addressed specifically in the previous post.  Take a look there

Windows and User Objects

Try opeingi up the  PB 9 version in PB 7.   If this works, Just save it and you are good to go.   If blows up,  here are several  possible causes:

  • An invalid global variable is being referenced
  • A non-standard variable is of a datatype which was not included found in the search path
  • A non-standard variable refers to an object which has not yet been migrated to PB 7

You can clean up the code by editing the .srw export file with a text editor and commenting out the offending references.  When you import the file, make sure the PB 9 version is not in your library path, otherwise the import will fail.  You will not get a helpful error message or PowerBuilder will crash.

Advertisements

April 17, 2008 Posted by | 1. PowerBuilder General, PowerBuilder Versions | , , , , , , , , , , | Leave a comment

Migrating a DataWindow from PB 9 Back to PB 7


You may find yourself working in PB 7 and wanting to use a DataWindow developed in PB 9. This can be done if you export the PB 9 code (export may be done in PB 7), update the srd file, and then import it to your PB7 PBL.

PB 9 SRD file

$PBExportHeader$d_cycl_validation.srd
release 9;
datawindow(units=0 timer_interval=0 color=67108864 processing=0 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes hidegrayline=no )
summary(height=0 color="536870912" )
footer(height=0 color="536870912" )
detail(height=68 color="536870912" )
table(column=(type=char(10) updatewhereclause=yes name=cycl_rtg_id dbname="CYCL_RTG_ID" )
 column=(type=char(32) updatewhereclause=yes name=descr dbname="DESCR" )
 retrieve="SELECT  CRM.CYCL_RTG_ID,
        CRM.DESCR
FROM    QUAD0062..CYCL_RTG_MSTR CRM
WHERE   CRM.CYCL_RTG_ID = :CYCLE_ID
AND     CRM.PDCT_CD = 'M'
AND     CRM.RTG_CLA <> 'D'"
column(band=detail id=2 alignment="0" tabsequence=32766 border="5" color="0" x="347" y="4" height="56" width="1024" format="[general]" html.valueishtml="0"  name=descr visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0  font.face="Arial" font.height="-8" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
text(band=detail alignment="0" text="Description:" border="0" color="0" x="9" y="4" height="56" width="311" html.valueishtml="0"  name=t_1 visible="1"  font.face="Arial" font.height="-8" font.weight="700"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" )
export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )
import.xml()
export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" )

Changes Needed for Converting Sample SRD File to PB 7

Note, lines 18 -21 refer to the last 4 lines of your SRD file.

  • Line 2
    • Change “Release 9” to “Release 7
  • Line 3
    • Delete “print.printername=””
    • Delete “print.canusedefaultprinter=yes
    • Delete “print.cliptext=no print.overrideprintjob=no print.collate=yes hidegrayline=no” (end of the line)
  • Line 18
    • At the end of the line, delete “encodeselflinkargs=”1″ netscapelayers=”0″
  • Line 19-21
    • Delete these lines

PB 7 SRD file

The final SRD file is now ready to be imported into PB 7. It looks like the following:

 $PBExportHeader$d_cycl_validation.srd
 release 7;
 datawindow(units=0 timer_interval=0 color=67108864 processing=0 HTMLDW=no print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.prompt=no print.buttons=no print.preview.buttons=no )
 summary(height=0 color="536870912" )
 footer(height=0 color="536870912" )
 detail(height=68 color="536870912" )
 table(column=(type=char(10) updatewhereclause=yes name=cycl_rtg_id dbname="CYCL_RTG_ID" )
  column=(type=char(32) updatewhereclause=yes name=descr dbname="DESCR" )
  retrieve="SELECT  CRM.CYCL_RTG_ID,
         CRM.DESCR
 FROM    QUAD0062..CYCL_RTG_MSTR CRM
 WHERE   CRM.CYCL_RTG_ID = :CYCLE_ID
 AND     CRM.PDCT_CD = 'M'
 AND     CRM.RTG_CLA <> 'D' " arguments=(("CYCLE_ID", string)) )

April 16, 2008 Posted by | 2. Datawindows, PowerBuilder Versions | , , , , , , , , , , | Leave a comment