Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

setting marin.right fails

1 view
Skip to first unread message

Jack E. Wasserstein, DDS, Inc.

unread,
Oct 28, 2004, 7:10:38 PM10/28/04
to corel.wpoffice.paradox-dev

The code below fails when I try to set the right marin of a report. If I
open the report and change the right margin manually I can ajust it up to 2"
before getting paradox to complain that I have violated a report objects
boundary. However, when running the code below it fails saying that I have
used an illegal value for the right margin. If I comment out that line of
code the other margins can be adujusted correctly it is only the right
margin. Any ideas why this is happening?

Thanks


r.load("icstat.rsl", WinStyleHidden)
rt = 360
lt = 1440
tp = 2880
bm = 720

pagewidth = (8.5*1440)
objectsize = pagewidth-rt-lt

if objectsize <=0
then
msginfo("Report settings", "invalid margin settings")
return
endif

r.margins.right = rt
r.margins.left = lt
r.margins.bottom = bm
r.margins.top = tp

Uwe Tiedje

unread,
Oct 29, 2004, 4:01:08 AM10/29/04
to corel.wpoffice.paradox-dev

Jack,

I think you need to have an uiObject, a 'frame' containing all the objects
in your report.
This frame has to be set visible=false during runtime or assigned a color
not seen on your prints.
Then you attach this uiObject, get the original position and add the new x /
y values.
With 'designModified = false' and 'myReport.save()' you finish the job.

Here is an example I use in several apps.

Uwe

var
myReport Report
RepForm UIObject
newVal_H longInt
newVal_V longInt
repname string
endVar


repname = ":RPTS:ReportName.rsl"

if myReport.load(repname,WinStyleHidden) then
if RepForm.attach(myReport.uiGroup) then
;| uiGroup is the area you want to move
newVal_H=longInt(round(ConstOffsetHorizontal+(mmToTwip*NewOH),0))

;| User enters new Value in mm, Pdx needs values in twips
newVal_V = longInt(round(ConstOffsetVertikal+(mmToTwip*NewOV),0))
uiGroup.Position = point(newVal_H,newVal_V)

;| now set the new x/y-position
myReport.designModified = false

;| save modified report
if not myReport.save() then
errorShow()
endIf
else
errorShow()
endIF
else
errorShow()
endIf

"Jack E. Wasserstein, DDS, Inc." <Ja...@Wasserstein.com> schrieb im
Newsbeitrag news:4181765c$1_1@cnews...

var
myReport Report
RepForm UIObject
neuerWert_H longInt
neuerWert_V longInt
repname string
endVar


switch
case Beleg = "Scheck":
repname = ":PRG:SHEKHEZ.RSL"
case Beleg = "Ueberweisung":
repname = ":PRG:UEBERWEI.RSL"
endSwitch
if myReport.load(repname,WinStyleHidden) then
if RepForm.attach(myReport.Formgruppe) then

;// Repform ist der Bereich, der verschoben werden soll
neuerWert_H
=longInt(round(KonstOffsetHorizontal+(mmNachTwip*NeuOH),0))

;// Anwender gibt mm ein, berechnet werden Twips
neuerWert_V = longInt(round(KonstOffsetVertikal+(mmNachTwip*NeuOV),0))
RepForm.Position = point(neuerWert_H,neuerWert_V)

;// hier wird die neue x/y-Position gesetzt
myReport.designModified = false

;// Anwender wird nicht gefragt, ob gespeichert werden soll
if not myReport.save() then

;// speichern des geänderten Reports
errorShow()
endIf
else
errorShow()
endIF
else
errorShow()
endIf
endProc

Jack E. Wasserstein, DDS, Inc.

unread,
Oct 29, 2004, 7:36:02 PM10/29/04
to corel.wpoffice.paradox-dev

Try this please. Create a blank report. Place an object on the report, then
try to adjust the right margin through OPAL and let me know if it works for
you. For what ever reason, I get an error message that I have tried to
assign an illegal value. But i only get the message with the right margin.
The others work fine


"Uwe Tiedje" <uwe.t...@arcor.de> wrote in message
news:4181f202$1_2@cnews...

Bertil Isberg

unread,
Oct 30, 2004, 6:44:58 AM10/30/04
to corel.wpoffice.paradox-dev

Jack

When changing the margins.right property through ObjectExplorer, the
original value is restored immediatley. It can only be changed through Page
Setup dialog. Running ObjectPAL, the error only occurs if the report
contains an object. This seems to indicate, you have to set the right
margin before adding objects to the report.

In Paradox7, you'll get a message "This value can not be set", when trying
to change the right margin.

--
Bertil Isberg - CTECH
Paradox buglist:
online: http://w1.826.comhem.se/~u82608896/
FAQ newsgroup: corel.wpoffice.paradox-faq

0 new messages