Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shrinking a report
Message
From
27/11/2007 11:51:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Shrinking a report
Miscellaneous
Thread ID:
01271475
Message ID:
01271475
Views:
99
Someone who's not around wtote the code below that shrinks a report that normally prints at 11 X 17 to a report that print 8 1/2 X11, and it works fine.

We wrote another VFP9 report using mulitple detail bands, also working fine, and the client has asked if we can shrink that one the way the other one shrinks.

I tried it and got chaotic results- Bands just disappear or band A data winds up with Band B. A tweak of the report here and there hepls somewhat, but it's still a mess.

The detail bands have headers and detail sections, but the footers are not used. Several fields in the detai bands stretch with overflow and there are lots of print whens.

Does anyone have any suggestions?





PRIVATE lc_frxname, ln_fact

lc_frxname = "mailjob.frx"
*-- Shrink report form
SELECT 0
USE &lc_frxname ALIAS oldtick
= AFIELDS(la_tmp)

*-- SETUP TEMPORARY FILE NAMES FROM SEED
gc_tmpf1 = "0" + LEFT(SYS(3),6) + "1"
CREATE TABLE (gc_tmpf1 + ".frx") FROM ARRAY la_tmp
USE

SELECT 0
USE (gc_tmpf1 + ".frx") ALIAS gc_tmpf1

SELECT gc_tmpf1
APPEND FROM DBF("oldtick")

USE IN oldtick

SELECT rptfile
GO TOP

*-- Factor to shrink report
ln_fact = .7

SELECT gc_tmpf1
GO TOP
REPLACE expr WITH ""
REPLACE tag WITH ""
REPLACE tag2 WITH ""
SCAN WHILE NOT EOF()
IF objtype = 9
*-- Height of Page, Detail and Footer bands
IF objcode = 1
REPLACE height WITH 46980
ENDIF
IF objcode = 4
REPLACE height WITH 1146
ENDIF
IF objcode = 7
REPLACE height WITH 30625
ENDIF
ELSE
REPLACE vpos WITH vpos * ln_fact
REPLACE hpos WITH hpos * ln_fact
REPLACE height WITH height * ln_fact
REPLACE width WITH width * ln_fact
REPLACE fontsize WITH INT(fontsize * ln_fact)
ENDIF
ENDSCAN

USE IN gc_tmpf1
RETURN gc_tmpf1

Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Next
Reply
Map
View

Click here to load this message in the networking platform