1. Julián Tagarro
  2. PowerBuilder
  3. Thursday, 21 May 2020 19:50 PM UTC

Hi all,

I'm migrating our apps from PB 9.0. 

We use a lot of dynamically created datawindows using SyntaxFromSQL and now I can see that the column width created with PB2019 r2 are different (wider) that the column width created by PB 90 (same select, same DMBS).

Any clue on this ? Any parameter I can set to the "presentation" variable of SyntaxFromSQL in order to get the same behaviour that we use to have ?

Please, see file attached.

Regards,

_______________

Julián Tagarro

NeoSistemas SRL

Attachments (1)
Accepted Answer
Julián Tagarro Accepted Answer Pending Moderation
  1. Wednesday, 27 May 2020 18:49 PM UTC
  2. PowerBuilder
  3. # Permalink

I will continue this thread by opening a ticket in the standard support system.

Thanks all for your help.

Regards,

____________

Julián Tagarro

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 27 May 2020 16:49 PM UTC
  2. PowerBuilder
  3. # 1

Hi Julián;
 
   FWIW:  You can always "standardize" any Table & Column's look an feel by entering the font, default dimensions, colour, edit style, etc properties in the DB Painter for each Table & Column. These are called "extended attributes" and are stored in the PBCATxxx tables in your DEV DB Server. If you export these PBCATxxx tables and their data from your DEV DB server over to the Prod DB server, the SyntaxFromSQL() command will utilize these "extended attributes" look & feel standards on every dynamic DWO also in production.Thus over-riding the PBVM "on-the-fly" calculations for default font, size, colour, etc. Making the PROD environment now identical to your DEV environment when using the SyntaxFromSQL() command for any Table/Column referenced.

Food for thought.  ;-)

Regards ... Chris

Comment
  1. Julián Tagarro
  2. Wednesday, 27 May 2020 17:49 PM UTC
Hi Chris,

Thanks for your answer.

The datawindows created with SyntaxFromSQL are used in several places and for several tables in our app. I would not like to add this task (mantain PBCATxxx tables both development and production) in order to get the same results I used to have if there isn't a true valid reason.

Besides, the second parameter of SyntaxFromSQL shouldn't be enough ?

Regards,

Julián Tagarro.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 27 May 2020 19:49 PM UTC
HI Julián ... that is a good question. I have no idea. FWIW: The key change in newer O/S versions though is the move away from "San Serif" but, I could be way out on that guess. I have now transferred your ticket #4708 on this issue over to Engineering. Lets see what they say.
  1. Helpful
There are no comments made yet.
Julián Tagarro Accepted Answer Pending Moderation
  1. Sunday, 24 May 2020 20:27 PM UTC
  2. PowerBuilder
  3. # 2

Hi all,

Update: this is an example of the code used to build our dynamic dw.

// SQLCA.DBMS = "OLE DB"

ls_select = "Select EmpresCod, SucursCod, ClientVtasCod, ClientVtasNomb From ClientesVentas"

ls_estilo = 'Style ( Type = Tabular Horizontal_Spread = 20 Vertical_Spread = 25 ) ' + &
'Datawindow ( Color = ' + String ( RGB ( 255 , 255 , 255 ) ) + ' ) ' + &
' Column ( Font.Face = "Ms Sans Serif" Font.Height = -8 Font.Weight = 400 ' + &
' Border = 0 Color = ' + String ( RGB ( 0 , 0 , 0 ) ) + &
' Background.Mode = 1 Background.Color = ' + String ( RGB ( 255 , 255 , 255 ) ) + ' ) ' + 'Text ( Font.Face= "Ms Sans Serif" Font.Height = -8 Border = 6 Color = ' + String ( RGB ( 0 , 0 , 0 ) ) + ' Background.Mode = 0 Background.Color = ' + String ( RGB ( 255 , 255 , 255 ) ) + ' ) '

ls_sintaxis = SQLCA.SyntaxFromSQL ( ls_select , ls_estilo, ls_errores )

Update 2: attached there is an image comparing the results of running this snippet in 3 different versions of PowerBuilder. You can see there that PB 9 = PB 11.5 and the difference occurs in PB2017.

Greetings !!!

_______________

Julián Tagarro

NeoSistemas SRL

Attachments (1)
Comment
  1. Julián Tagarro
  2. Tuesday, 26 May 2020 20:16 PM UTC
Good afternoon.

Anybody has a clue on this matter ? I've made 3 example apps and uploaded the results in 3 different versions of PB.

Regards, Julián
  1. Helpful
There are no comments made yet.
John Murphy Accepted Answer Pending Moderation
  1. Sunday, 24 May 2020 18:53 PM UTC
  2. PowerBuilder
  3. # 3

I still have PB9 up if you want me to test it.  I can't see from your picture but did you set the font. PB9 defaulted to MS Sans Serif, PB2019 defaults to Tahoma and they are different sizes.

1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz Tahmoa 8

1234567890ABCDEFGHIJKLMNOPQUSTUVWXYZabcedfghijklmnopqrstuvwzyz  Arial 8

The example uses Ariel as this window does not have MS Sans Serif as an option

Comment
  1. Michael Kramer
  2. Sunday, 24 May 2020 18:58 PM UTC
Good point!
  1. Helpful
  1. Julián Tagarro
  2. Sunday, 24 May 2020 20:15 PM UTC
Hi John,



Thanks for your reply.



I did set the font. Please take a look at the example written in a separate response (I cant paste clear snipets of code in this window).



Regards,

_________________

Julian Tagarro

NeoSistemas SRL



  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 21 May 2020 21:15 PM UTC
  2. PowerBuilder
  3. # 4

Greetings, Julian - 

Is the same Windows printer selected in each version. PB uses the properties of the currently selected printer when generating syntax.

Do you have access to a pre-2017 version of PB later than version 9 (v12.5 or 12.6, for example) that you could try this with? I'm curious what the results would be.

Regards, John

Comment
  1. Julián Tagarro
  2. Friday, 22 May 2020 20:04 PM UTC
Hi John,



Thakns for your answer.



Same printer, same computer. Besides, in my expirience, SyntaxFromSQL never used the Windows default printer. We have many installations of our products in several computers and the dynamicaly created datawindows allways work in the same way, no matter what printer is selected.



I have access to PB11.5. I will try with a simple app and keep you posted.



Regards,



_______________

Julián Tagarro

NeoSistemas SRL
  1. Helpful
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Thursday, 21 May 2020 20:31 PM UTC
  2. PowerBuilder
  3. # 5

I would expect columns to be "identical width - or almost identical". In your example I see

  • Everything have comparable Height and Y whereas Width and X differs
  • Columns ID=1, 2, and 3 increased width by 20%
  • Label for ID=3 increased width by 22%
  • Column ID=4 is just 9% wider

So I would look for following "potential differences" as root cause. You may find more than one apply to your scenario:

  • Are X and Width the ONLY differences in generated code PB-old vs. PB-new?
    The additional differences may indicate what the reason is.

  • Does DataWindow syntax become "identical" when you convert the DataWindow's units from PBU to pixels?
    Different screen config impacts pixel-to-PBU ratios.

  • Are database column definitions identical when PB-old and PB-new created the DW syntax?
    Column definition may change over time or differ in DEV vs. TEST vs. QA vs. PROD environments
    Example > number(15, 2) => number(17, 4)

  • What is max DECIMAL size in your PB-old vs. PB-new?
    PowerBuilder changed limit on DECIMAL type at some point; I don't remember which version.
    That potentially requires more space to fit large values.

 

HTH /Michael

Comment
  1. Julián Tagarro
  2. Thursday, 21 May 2020 20:52 PM UTC
Hi Michael,



Thanks for your help !!!



Above all, the example I attached is the result of calling SyntaxFromSQL in the exact same object with the exact same SQL statement and the exact same "presentation" string variable. With this result, then I call dw_data.Create ( ls_syntax , ls_err )

__

Columns ID=1, 2, and 3 increased width by 20%

Label for ID=3 increased width by 22%

Column ID=4 is just 9% wider



I made the exact same comparisson. I was looking for a constant, but I didn't find it.

__

Are X and Width the ONLY differences in generated code PB-old vs. PB-new?



For what I can see, yes. Then PB2019R2 adds the new properties available.

__

Does DataWindow syntax become "identical" when you convert the DataWindow's units from PBU to pixels?



Both have (0 -PBU) as units

----

Are database column definitions identical when PB-old and PB-new created the DW syntax?



Same table, same database.

----

What is max DECIMAL size in your PB-old vs. PB-new?



All the numeric columns are N(5). PB "converts" them to Decimal(0) when SyntaxFromSQL is called.



----



Should I upload both txt's files insted of an image ?



Regards,

_______________

Julián Tagarro

NeoSistemas SRL
  1. Helpful
  1. Michael Kramer
  2. Thursday, 21 May 2020 21:06 PM UTC
No problems with the image. I already looked.

Unfortunately I have access to 12.5, 2017R3, and 2019R2 so I'm in no condition to check myself doing a simple SELECT of N(5) columns into DW object and see results.

Hopefully someone else joins this discussion and has access to PB9.

I wonder - knowing the DECIMAL columns are N5 => 20% increase is similar to allowing one more digit - or include sign in potential display width. - - therefore - - When you EDIT on screen using any of the generated DW objects => how much space is actually available in the column? -- Can both display "99999" ? Can both display "-99999"?
  1. Helpful
  1. Julián Tagarro
  2. Friday, 22 May 2020 20:24 PM UTC
Hi Michael,



Thanks for your reply.



Actually, 2 columns are N(5) and the other es N(8). My mistake, sorry about that.



PB 90 gives all of them width = 247 (tested, more than enough to display -99999) and PB 2019 calculates width = 329 for N(5) and width = 359 for N(8).



I will check if allways N(5) = 20% increase (calling SyntaxFromSQL with select of different tables), just to see if there is a pattern. Anyway, I will love to know the origin of this change of behaviour.



Regards,

_______________

Julián Tagarro

NeoSistemas SRL
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.