Focal Point
fit to page in PDF format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6161074972

April 07, 2008, 07:47 AM
arvind
fit to page in PDF format
hi ,

In our reports , We have given user the privilige to deselect or select the columns he wants on the report. So when a default report having 10 columns is exported to PDF format. It fits to the page - width appropriately. Now , when the user deselects three columns and 7 columns are displayed in PDF format, the report does not fit to page width.

There is some empty space left after the three columns were removed. Is there any fit to page option in Webfocus , so that columns dynamically fit to page width??Thank you very much in advance..


WebFOCUS 714
Windows XP
Output: HTML,PDF,Excel
April 07, 2008, 08:13 AM
Leah
Do you just 'noprint' the items on the page when they 'de-select'? I've never seen a fit to page, but then I learn something new every day on this forum. Normally the report uses the columns needed and that's it. Squeeze off might or might not do it. Do a search on the forum on PDF formats. Much discussion to be found.


Leah
April 07, 2008, 08:14 AM
Tony A
Nothing dynamic, to my knowledge.

Read Mickey's articles on the tips 'n techniques page for insights on PDF layout using wrap etc.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 07, 2008, 08:21 AM
arvind
hi leah tony ,
in our report we pass parameters from HTML file to FEX file.. The parameters are passed depending on the columns selected using checkbox provided in the user input page...
I tried Squeeze = OFF..it doesn work.. already seached PDF related topics in this forum..could not find anything related to "fit to page "in PDF.. Any suggestions please ??
thank you sir


WebFOCUS 714
Windows XP
Output: HTML,PDF,Excel
April 07, 2008, 08:37 AM
Leah
Dynamically change font size?????
Dynamically change the margin on the left??
Can't really think of anything else


Leah
April 07, 2008, 08:46 AM
arvind
Frowner thank you leah..guess i am short of luck here


WebFOCUS 714
Windows XP
Output: HTML,PDF,Excel
April 07, 2008, 09:01 AM
Leah
WinkYou could always switch the output to a spreadsheet then who'd care? Forgive me couldn't resist. Sometimes keeping the customer happy turns into more of a challange than creating the report.


Leah
April 07, 2008, 09:16 AM
mgrackin
There is no fit to page setting that I know of. What you need to do is set the WIDTH/WRAP values of the columns dynamically depending on the number of fields selected.

The following is an example of using a DEFINE FUNCTION to calculate the column width based on the number of fields selected.

The &NUMFLDS will be the total number of fields selected. In the example 9.5 represents the amount of printable space on the report. This assumes a .75 inch margin on the left and right. My example also assumes LANDSCAPE orientation.

DEFINE FUNCTION COLWIDTH (TOTCOLS/I2)
EACHCOL/F4.2=(9.5 - (TOTCOLS * 0.2)) / TOTCOLS;
COLWIDTH/A4=FTOA(EACHCOL,'(F4.2)','A4');
END
-RUN

-SET &NUMFLDS=5;
-SET &COLWIDTH=COLWIDTH(&NUMFLDS);

TABLE FILE CAR
PRINT COUNTRY CAR MODEL BODYTYPE SEATS
-* RCOST DCOST
-* SALES MPG RPM
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, ORIENTATION=LANDSCAPE,
LEFTMARGIN=0.75, RIGHTMARGIN=0.75, LEFTGAP=0.10, RIGHTGAP=0.10,$
TYPE=REPORT, WRAP=&COLWIDTH,$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
April 08, 2008, 04:36 AM
arvind
hi mickey,
thanks for the reply..but in your program when i remove columns seats bodytype..the rightmargin is not constant (0.75)..it keeps on increasing.. My requirement is that there must not be any empty space even after the columns are removed...and the space is utilised properly
thank you sir


WebFOCUS 714
Windows XP
Output: HTML,PDF,Excel
April 08, 2008, 05:50 AM
Tony A
Arvind,

Once again you have not looked at the actual code and just expected it to work.

In Mickey's code you will see that there is a variable called &NUMFLDS, this is the initial driver of the column width changes. You will have to modify this in dialogue manager to reflect the number of columns that you are processing. So for your comment above, you would have needed to change the &NUMFLDS to be equal to 3 instead of 5.

If you don't read the samples and try to understand them them you will find that folks start to avoid responding to your pleas for help.

Help others to help you!!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 08, 2008, 08:21 AM
mgrackin
Arvind,

You need to add code in order to figure out how many fields the user selected and then plug that number into the &NUMFLDS variable. It will then calculate the proper column width for all the columns.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
April 08, 2008, 09:10 AM
arvind
hi mickey ,
thank you very much for the reply.. hmmm In my report , the user input page is provided . Users select or deselect a particular column using a checkbox... So the no. of boxes checked will give the count of the columns in a report.. i need to pass this value to hte &NUMFLDS parameter in FEX..i tried using this as a hidden parameter..It s still not working...i will keep working on this ...

Any way mickey your FEX program is fabulous..thts y god has send u to help us poor souls Smiler


WebFOCUS 714
Windows XP
Output: HTML,PDF,Excel
April 08, 2008, 10:39 AM
mgrackin
Arvind,

Since each check box is treated as a separate variable and is only passed to the FEX when it is selected, you probably should create a javascript function that counts the number of check boxes that are seelcted and then populates a hidden input box for NUMFLDS with the total.

You could probably do this in the FEX as well but it is probably easier to do it with a javascript function and then just pass the NUMFLDS variable to the FEX.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011