Focal Point
[CLOSED] Free form reports

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

January 17, 2012, 09:07 PM
Enigma006
[CLOSED] Free form reports
Hi

I am new to free form reporting in webfocus though I have done lots of other kind of reports.
Can some one guide me through development of free form reports or post sample code with car file.

I am trying to develop a report that should be something like this.

  

Field1: Data1    Field2: Data2  Field3: Data3
Field4: Data4              Field5: Data5
Field6: Data6

Field7:
Data7

Field8:
Data8

Field9:              Field10: Data10
Data9                Field11: Data11
                     Field12: Data12
                     Field13: Data13



Its basically like an invoice or a bill.
Please provide me suggestions.

Thanks

This message has been edited. Last edited by: Kerry,


8.1.05
HTML,PDF,EXL2K, Active, All
January 17, 2012, 09:14 PM
Waz
What format will the output be ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 17, 2012, 11:47 PM
Enigma006
quote:
Originally posted by Waz:
What format will the output be ?


Hi Waz..it will be in Excel or PDF mostly with chances of HTML.


8.1.05
HTML,PDF,EXL2K, Active, All
January 18, 2012, 12:07 AM
Waz
For PDF you could use OBJECT=STRING.

DEFINE FILE CAR
 Blank/A1 WITH COUNTRY = ' ' ;
END
TABLE FILE CAR
PRINT Blank AS ''
WHERE RECORDLIMIT EQ 1
ON TABLE SET PAGE NOPAGE
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLESHEET *
TYPE=REPORT, OBJECT=BOX   , NAME='BOX001', POSITION=(0.200 0.400),DIMENSION=(1.10 3.00),BORDER-COLOR=RED, BORDER=HEAVY,BACKCOLOR=RGB(212 212 212),$
TYPE=REPORT, OBJECT=STRING, NAME='text1', TEXT='Text1', POSITION=(0.200 0.400), MARKUP=OFF, WRAP=ON, DIMENSION=(4.234 0.528), font='ARIAL', color=RGB(0 0 0),  size=10, $
TYPE=REPORT, OBJECT=STRING, NAME='text2', TEXT='Text2', POSITION=(0.200 1.400), MARKUP=OFF, WRAP=ON, DIMENSION=(4.234 0.528), font='ARIAL', color=RGB(0 0 0),  size=10, $
TYPE=REPORT, OBJECT=STRING, NAME='text3', TEXT='Text Line 3', POSITION=(2.200 2.400), MARKUP=OFF, WRAP=ON, DIMENSION=(4.234 0.528), font='ARIAL', color=RGB(0 0 0),  size=10, $
ENDSTYLE
END


Each output type may need to be done separately.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 18, 2012, 05:37 AM
<FreSte>
Or you could use something like this:
(add SUBHEAD/SUBFOOT's for more detail)


TABLE FILE CAR
HEADING
"<+0>Country<+0>: <COUNTRY <+0>Car<+0>: <CAR"
"<+0> <+0>Other text<+0>: Some other stuff <SEATS"
" "
" "
FOOTING
" "

BY COUNTRY NOPRINT
ON COUNTRY PAGE-BREAK

BY CAR NOPRINT
BY MODEL NOPRINT

ON TABLE SET LINES 99999
ON TABLE SET TITLES OFF
ON TABLE SET PAGE NOPAGE
ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *
TYPE=REPORT     ,UNITS=PTS   ,FONT='VERDANA', SIZE=8        ,$
TYPE=REPORT     ,BORDER=0    ,BORDER-COLOR=RGB(210 210 210) ,$

TYPE=HEADING, LINE=1 ,OBJECT=TEXT  ,ITEM=1, STYLE=BOLD ,$
TYPE=HEADING, LINE=1 ,OBJECT=FIELD ,ITEM=1, WIDTH=80   ,$
TYPE=HEADING, LINE=1 ,OBJECT=TEXT  ,ITEM=4, STYLE=BOLD ,$
TYPE=HEADING, LINE=1 ,OBJECT=FIELD ,ITEM=2, WIDTH=80   ,$

TYPE=HEADING, LINE=2 ,OBJECT=TEXT  ,ITEM=1, WIDTH=131   ,$

ENDSTYLE
END

January 18, 2012, 02:11 PM
Enigma006
Hi Freste

This method is working good for me as I started to use it. But this looks like HTML format.
Is it a different way for Excel?
quote:
Originally posted by FreSte:
Or you could use something like this:
(add SUBHEAD/SUBFOOT's for more detail)


TABLE FILE CAR
HEADING
"<+0>Country<+0>: <COUNTRY <+0>Car<+0>: <CAR"
"<+0> <+0>Other text<+0>: Some other stuff <SEATS"
" "
" "
FOOTING
" "

BY COUNTRY NOPRINT
ON COUNTRY PAGE-BREAK

BY CAR NOPRINT
BY MODEL NOPRINT

ON TABLE SET LINES 99999
ON TABLE SET TITLES OFF
ON TABLE SET PAGE NOPAGE
ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *
TYPE=REPORT     ,UNITS=PTS   ,FONT='VERDANA', SIZE=8        ,$
TYPE=REPORT     ,BORDER=0    ,BORDER-COLOR=RGB(210 210 210) ,$

TYPE=HEADING, LINE=1 ,OBJECT=TEXT  ,ITEM=1, STYLE=BOLD ,$
TYPE=HEADING, LINE=1 ,OBJECT=FIELD ,ITEM=1, WIDTH=80   ,$
TYPE=HEADING, LINE=1 ,OBJECT=TEXT  ,ITEM=4, STYLE=BOLD ,$
TYPE=HEADING, LINE=1 ,OBJECT=FIELD ,ITEM=2, WIDTH=80   ,$

TYPE=HEADING, LINE=2 ,OBJECT=TEXT  ,ITEM=1, WIDTH=131   ,$

ENDSTYLE
END



8.1.05
HTML,PDF,EXL2K, Active, All
January 18, 2012, 02:11 PM
Enigma006
Waz, any ways for Excel?
quote:
Originally posted by Waz:
For PDF you could use OBJECT=STRING.

DEFINE FILE CAR
 Blank/A1 WITH COUNTRY = ' ' ;
END
TABLE FILE CAR
PRINT Blank AS ''
WHERE RECORDLIMIT EQ 1
ON TABLE SET PAGE NOPAGE
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLESHEET *
TYPE=REPORT, OBJECT=BOX   , NAME='BOX001', POSITION=(0.200 0.400),DIMENSION=(1.10 3.00),BORDER-COLOR=RED, BORDER=HEAVY,BACKCOLOR=RGB(212 212 212),$
TYPE=REPORT, OBJECT=STRING, NAME='text1', TEXT='Text1', POSITION=(0.200 0.400), MARKUP=OFF, WRAP=ON, DIMENSION=(4.234 0.528), font='ARIAL', color=RGB(0 0 0),  size=10, $
TYPE=REPORT, OBJECT=STRING, NAME='text2', TEXT='Text2', POSITION=(0.200 1.400), MARKUP=OFF, WRAP=ON, DIMENSION=(4.234 0.528), font='ARIAL', color=RGB(0 0 0),  size=10, $
TYPE=REPORT, OBJECT=STRING, NAME='text3', TEXT='Text Line 3', POSITION=(2.200 2.400), MARKUP=OFF, WRAP=ON, DIMENSION=(4.234 0.528), font='ARIAL', color=RGB(0 0 0),  size=10, $
ENDSTYLE
END


Each output type may need to be done separately.



8.1.05
HTML,PDF,EXL2K, Active, All
January 18, 2012, 03:49 PM
Waz
If you can get it working for HTML, then you can return the reprot as Excel.

Hold the HTML report as a name, then...

SET HTMLFORMTYPE=XLS
-HTMLFORM {name}


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 19, 2012, 12:54 PM
Enigma006
Hi Freste

This method is workig good for me.
I am trying to WRAP a big text field which is in the heading. I am able to wrap a normal field in PRINT but in heading, same techniques does not work. When I print this in PDF, only some text is getting displayed and other text is just gone. I want that to go to next line.

Can you let me know any technique.

Thank you


8.1.05
HTML,PDF,EXL2K, Active, All
January 19, 2012, 01:55 PM
Dgraff
Another method is to do it entirely as a heading and turn the alignment grid on. I had to use this when trying to match a given format for a state reporting requirement. It worked in all three output formats but Excel and PDF for sure.


Duane

WebFOCUS 8.0.7
DS 8.0.7 AS 8.0.7
Windows
Output: Excel, HTML, PDF, AHTML,Mobile
In Focus 1982
January 19, 2012, 02:10 PM
Enigma006
Hi Dgraff

I already this option before posting here. It did not work for me or I did something wrong?!
quote:
Originally posted by Dgraff:
Another method is to do it entirely as a heading and turn the alignment grid on. I had to use this when trying to match a given format for a state reporting requirement. It worked in all three output formats but Excel and PDF for sure.



8.1.05
HTML,PDF,EXL2K, Active, All
January 19, 2012, 05:41 PM
<FreSte>
I once also had a problem formatting long text in PDF. Maybe this post can help you any further.

-Fred
January 24, 2012, 10:23 AM
Enigma006
Hi Freste
everythign is working good and I am able to get the report well except one issue. Smiler

When I have 2 fields in a line, when one field length increases (number of characters), the other text and fields in same line are moving towards right and if it decreases, they are moving towards left. Can we make them fixed without movement?

Thank you..


8.1.05
HTML,PDF,EXL2K, Active, All
January 24, 2012, 03:36 PM
ABT
Would this not be as simple as Defining the field the data would be in? Is your data Variable length?
- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
January 24, 2012, 03:45 PM
Waz
This is where you will have the most problems.

This can be handled in the stylesheet, but you will have different code for different formats.

You will also need to decide if the first field gets too long, do you truncate it, or wrap it.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 25, 2012, 03:03 PM
Enigma006
quote:
Originally posted by ABT:
Would this not be as simple as Defining the field the data would be in? Is your data Variable length?
- ABT


yes its variable. number is D20.2 format, so it could be of any length..


8.1.05
HTML,PDF,EXL2K, Active, All