1. Eduardo G.
  2. PowerBuilder
  3. Monday, 2 December 2019 15:53 PM UTC

Hi, I have a PSR (Powersoft Report) file that contains many visual objects, has no database connection, and it has been detected that it has grown twice the size when modified with PB2017R3:

Old version: 25MB
Version with PB2017R3: 59MB

Internal character format:
Old version: Windows (CR LF) UCS-2 Little Endian
Version PB2017R3: Unix (LF) ANSI

Is there any way to make the size not so big?

Thank you.

Accepted Answer
Eduardo G. Accepted Answer Pending Moderation
  1. Thursday, 5 December 2019 11:26 AM UTC
  2. PowerBuilder
  3. # Permalink

The problem has been solved:

I scroll through all the objects in the current datawindow and dynamically create the objects in a new datawindow that serves as a base template.

I also detected an error in code that generated duplicates some objects.

FOR THE LAST TIME, any idea for the following?

The application dynamically creates tooltip in line and oval objects so that the user is informed, when the user finishes modifying when saving I make a cleaning removing the tooltip in the following way:

If dw_1.Describe( ls_Valor + ".Tooltip.Enabled" ) = "1" Then 
dw_1.Modify( ls_Valor + ".Tooltip.Enabled=0" )
dw_1.Modify( ls_Valor + ".Tooltip.Title=''" )
dw_1.Modify( ls_Valor + ".Tooltip.Tip=''" )
End If

Then I save the DW to PSR format but if I edit it, it is not removing the tooltip entries, although it has no content. This I understand is NOT correct.

line(name=a01481630 pointer="Help!" tag="02760008148439" band=detail background.mode="0" background.color="16777215" tooltip.enabled="0" tooltip.tip="" tooltip.title="" tooltip.isbubble="1" tooltip.textcolor="0" tooltip.backcolor="12632256" tooltip.icon="1" tooltip.maxwidth="0" tooltip.transparency="0" tooltip.delay.visible="32000" tooltip.delay.initial="0" tooltip.hasclosebutton="0" pen.style="0" pen.width="1" pen.color="12632256" x1="19211" y1="5519" x2="19278" y2="5487" )

Any possible solutions?

Thank you.

 

SOLUTION
The solution has been to go through each of the current objects and create new objects without the tooltip property.

The problem is the one already mentioned in this post about the way the DW works with the tooltip in the objects. When you create a DW, no object contains tooltip properties, when you add a tooltip to an object even if you deactivate it internally, all its properties exist. I think it would be necessary that in the Optimize for DW function the deactivated tooltip is removed internally. Besides, from code we can call a function and perform an Optimize for a DW.

 

Comment
  1. Brad Mettee
  2. Thursday, 5 December 2019 14:38 PM UTC
I just checked a few datawindows that have no objects using tooltips (using edit source). Every one of the objects in them has tooltip properties, including "" property values. I don't think there's a way to stop PB from saving those properties (in a DW or a PSR).
  1. Helpful
There are no comments made yet.
Brad Mettee Accepted Answer Pending Moderation
  1. Tuesday, 3 December 2019 14:31 PM UTC
  2. PowerBuilder
  3. # 1

Eduardo,

As Chris stated, PB 10 and up uses Unicode to store everything that's string based, and a PSR is basically a datawindow definition with data embedded in it. If you use a binary file viewer, you'll see where all the extra space has come from. Nearly every other byte in the newer files will be \x00 (a UTF character is typically 2 bytes long). There is NO WAY to make unicode PSRs smaller than what you're seeing. It's just the nature of the system now that it can support text data from every language.

Newer datawindows also contain additional properties per object, so depending on number of objects, they will increase PSR size as well.

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 2 December 2019 19:19 PM UTC
  2. PowerBuilder
  3. # 2

Hi Eduardo;

   Since PB 10.0, PB has been Unicode using the UTF-16LE standard (same as MS-Windows). While some newer features were added by Sybase, SAP and now Appeon along the way - PB's overall application size should have increased - but, only marginally.

   Since you are using a PSR (DataWindow Source + a copy of all DWO's Buffers), it could be possible that there is just "more datum" (# rows) than in the past. Also, the DWO(s) that produce the PSR could have changed column wise as well (# columns, column size, column data types, etc).

Regards ... Chris

 

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 3 December 2019 16:02 PM UTC
Hi Eduardo;

If you are just concerned about the saved file size, then you can update to PB2019 that now contains a "CompressorObject " class. You can use this object to compress the data-stream and make the PSR file considerably smaller.

If you want to stay on PB2017R3, then the other space saving option would be to use Roland's compression feature until you migrate to PB2019. FYI: http://www.topwizprogramming.com/freecode_zlibwapi.html

HTH

Regards ... Chris
  1. Helpful
  1. Eduardo G.
  2. Thursday, 5 December 2019 11:07 AM UTC
Hi Chris,



Thanks for the information, I'm very interested in "CompressorObject", as soon as we make the change I inform myself and implement it in code.



Thank you
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 5 December 2019 15:39 PM UTC
You are most welcome. Please come back to this thread and let us know how you made out after implementing the Compressor object on the PSR files.
  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.