Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

The Proprietary Designer Problem

Every Visual Basic programmer is familiar with the idea of an interactive designer.  For example, User-Defined Forms and UserControls are created and edited using VB6's intrinsic GUI designer.  The GUI designer allows the programmer to interactively edit a visual representation of the Form or UserControl and then stores most of the information in text-based files (.frm/.ctl) files. In addition to its GUI designer, Visual Basic allows third party component developers to create their own interactive component designers. These Third-Party Designers (3PDs) require the installation the third-party product.  They allow the programmer to interactively edit a visual representation of their components and store design-time information in proprietary binary format. This is somewhat similar to, but generally more obscure than, the problem of complex third-party control information stored for forms and controls in binary frx and ctx files. 

VB6 also has intrinsic DataReports, DataEnvironments, WebDocuments, and PropertyPages all with  their own custom designers using the same approach as the 3PDs. These types are rarely used in the codes we have seen so they are not fully supported by gmBasic.

 

Third-party designers typically create two types of files:
  • X.dsr: the text-based designer content declaring the 3PD subclass.  Normally this is a small declaration sometimes followed by code to support event handling and other processing.  The dsr will refer to most of the settings in the dsx file
  • X.dsx: the proprietary binary data detailing the structure and initial state of the 3PD subclass.  This dsx data may contain the declarations of many members of the subclass.

gmBasic is able to read and store information from text-based designer files, but it cannot read the information in proprietary dsx files.  Consequently, the details of the 3PD subclasses are undefined making it very difficult to interpret code that uses them.

In order to process a 3PD subclass, the dsx files must be converted to a text format that gmBasic can read, interpret, and load.

This article describes how different types of custom designer APIs are handled.

ActiveReports

Original VB6Generated DSX.RPT file

The dsr file has very little information in it besides the name of the designer subclass
and a reference to the dsx file containing the detailed of the subclass structure.

VERSION 5.00
Begin {9EB8768B-CDFA-44DF-8F3E-857A8405E1DB} Contact_Call_Log_Counts 
   Caption         =   "Company Check Form"
   ClientHeight    =   11115
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   15240
   StartUpPosition =   3  'Windows Default
   _ExtentX        =   26882
   _ExtentY        =   19606
   SectionData     =   "Contact_Call_Log_Counts.dsx":0000 <--- 
End
Attribute VB_Name = "Contact_Call_Log_Counts"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

After running the makedsr process with gmStudio I have a text file (*.dsr.rpt) containing the detailed
structure of the designer subclass that can be loaded by gmBasic.

Begin DDActiveReports2.ActiveReport Contact_Call_Log_Counts
    Version = 2.0
    Begin DDActiveReports2.Section ReportHeader
        Type         = "ReportHeader"
        Name         = "ReportHeader"
        Height       = "0"
        KeepTogether = "-1"
    End
    Begin DDActiveReports2.Section PageHeader
        Type         = "PageHeader"
        Name         = "PageHeader"
        Height       = "1095"
        KeepTogether = "-1"
        Begin DDActiveReports2.Label Label1
            Type      = "AR.Label"
            Name      = "Label1"
            Left      = "0"
            Top       = "0"
            Width     = "4800"
            Height    = "360"
            Caption   = " INSURANCE COMPANY"
            Multiline = "0"
            ClassName = "Normal"
            Style     = "font-size: 14.5pt; font-weight: bold;"
        End 
        Begin DDActiveReports2.Label State_Contract
            Type      = "AR.Label"
            Name      = "State_Contract"
            Left      = "720"
            Top       = "810"
            Width     = "5670"
            Height    = "270"
            Caption   = "STATE"
            Multiline = "0"
            ClassName = "Normal"
            Style     = "font-size: 12pt; font-weight: bold; text-align: right;"
        End 
        Begin DDActiveReports2.Label Label6
            Type      = "AR.Label"
            Name      = "Label6"
            Left      = "6690"
            Top       = "810"
            Width     = "960"
            Height    = "270"
            Caption   = "COUNT"
            Multiline = "0"
            ClassName = "Normal"
            Style     = "font-size: 12pt; font-weight: bold;"
        End 
        Begin DDActiveReports2.Line Line6
            Type         = "AR.Line"
            Name         = "Line6"
            X1           = "0"
            Y1           = "1080"
            X2           = "11550"
            Y2           = "1080"
            LineWeight   = "2"
            AnchorBottom = "0"
        End 
        Begin DDActiveReports2.Label Report_Title
            Type      = "AR.Label"
            Name      = "Report_Title"
            Left      = "0"
            Top       = "420"
            Width     = "10860"
            Height    = "330"
            Caption   = "CONTACTS MADE BY STATE"
            Multiline = "0"
            ClassName = "Normal"
            Style     = "font-size: 14.5pt; font-weight: bold;"
        End 
    End
    Begin DDActiveReports2.Section Detail
        Type         = "Detail"
        Name         = "Detail"
        Height       = "270"
        KeepTogether = "-1"
        Begin DDActiveReports2.Shape Shape45
            Type       = "AR.Shape"
            Name       = "Shape45"
            Left       = "11220"
            Top        = "13050"
            Width      = "0"
            Height     = "30"
            BackColor  = "0"
            LineWeight = "2"
        End 
        Begin DDActiveReports2.Field Report_Field
            Type      = "AR.Field"
            Name      = "Report_Field"
            DataField = "Report_Field"
            Left      = "690"
            Top       = "0"
            Width     = "5730"
            Height    = "270"
            ClassName = "Normal"
            Style     = "font-size: 12pt; text-align: right;"
        End 
        Begin DDActiveReports2.Field Report_Count
            Type      = "AR.Field"
            Name      = "Report_Count"
            DataField = "Report_Count"
            Left      = "6690"
            Top       = "0"
            Width     = "840"
            Height    = "270"
            ClassName = "Normal"
            Style     = "font-size: 12pt; text-align: right;"
        End 
        Begin DDActiveReports2.DataControl DC_Report
            Type     = "AR.DataControl"
            Name     = "DC_Report"
            Left     = "11010"
            Top      = "0"
            Width    = "210"
            Height   = "120"
            Visible  = "0"
            LockType = "1"
        End 
    End
    Begin DDActiveReports2.Section PageFooter
        Type         = "PageFooter"
        Name         = "PageFooter"
        Height       = "0"
        KeepTogether = "-1"
    End
    Begin DDActiveReports2.Section ReportFooter
        Type         = "ReportFooter"
        Name         = "ReportFooter"
        Height       = "330"
        KeepTogether = "-1"
        Begin DDActiveReports2.Field Sum_Count
            Type           = "AR.Field"
            Name           = "Sum_Count"
            DataField      = "Report_Count"
            Left           = "6690"
            Top            = "60"
            Width          = "840"
            Height         = "270"
            SummaryType    = "1"
            SummaryFunc    = "0"
            SummaryRunning = "0"
            ClassName      = "Normal"
            Style          = "font-size: 12pt; text-align: right;"
        End 
        Begin DDActiveReports2.Line Line7
            Type         = "AR.Line"
            Name         = "Line7"
            X1           = "6690"
            Y1           = "30"
            X2           = "7560"
            Y2           = "30"
            LineWeight   = "2"
            AnchorBottom = "0"
        End 
    End
End

 

Upsizing ActiveReports 

Note: The process for converting ActiveReports dsx files to dsx.rpt files only works for ActiveReports v2 format files.  Fortunately, the vendor offers an Upsizer.

---------------------------
ActiveReports Upsizer
---------------------------
Success . All Version 1.0 files have been renamed to .backup. and converted to Version 2.0

All references to objects using DDActiveReports (such as DDActiveReports.Pages) library prefix need to be changed to DDActiveReports2. The page margin properties have been moved from the report object to the PageSettings object which might require code change.
If you are using the Viewer control on forms please remove the viewer from the form and replace it with ActiveReports Viewer 2.0
---------------------------
OK
---------------------------

  • No labels