Focal Point
(solved)Getting "BAD VALUE IN STYLESHEET FILE " while use the column name as "A10000"

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

May 05, 2017, 11:41 AM
Dev
(solved)Getting "BAD VALUE IN STYLESHEET FILE " while use the column name as "A10000"
Hi,

Am getting a Styling issue if I use the column name as 'A10000'
Why my code is throwing error?
Here is my code....
 
TABLE FILE CAR
BY CAR AS 'A10000'
BY COUNTRY AS 'A20000'
BY SALES
BY MPG
ON TABLE SET ASNAMES ON 
ON TABLE HOLD AS AFORMAT
END
-RUN
TABLE FILE AFORMAT
BY A10000
BY A20000
BY SALES
ON TABLE SET PAGE NOPAGE
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XLSX 
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,SQUEEZE=ON,ORIENTATION=LANDSCAPE,HEADALIGN = BODY,$
TYPE=REPORT, FONT='ARIAL', SIZE=10, COLOR='BLACK', STYLE=NORMAL, $
TYPE=TITLE,  FONT='ARIAL NARROW', COLOR='WHITE', STYLE=BOLD, JUSTIFY=CENTER, BACKCOLOR=RGB(102 102 102),$
TYPE=DATA, COLUMN=A10000, JUSTIFY=CENTER, $
ENDSTYLE
END
 

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


8202, 8105M, 7.7.03
May 05, 2017, 11:59 AM
MartinY
Naming column starting with an "A" seems to be a reserved letter. I know about "C" and "N" that are reserved.
Using "Z", it's ok

TABLE FILE CAR
BY CAR AS 'Z10000'
BY COUNTRY AS 'Z20000'
BY SALES
BY MPG
ON TABLE SET ASNAMES ON 
ON TABLE HOLD AS AFORMAT
END
-RUN

TABLE FILE AFORMAT
BY Z10000
BY Z20000
BY SALES
ON TABLE SET PAGE NOPAGE
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
-*ON TABLE PCHOLD FORMAT XLSX 
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,SQUEEZE=ON,ORIENTATION=LANDSCAPE,HEADALIGN = BODY,$
TYPE=REPORT, FONT='ARIAL', SIZE=10, COLOR='BLACK', STYLE=NORMAL, $
TYPE=TITLE,  FONT='ARIAL NARROW', COLOR='WHITE', STYLE=BOLD, JUSTIFY=CENTER, BACKCOLOR=RGB(102 102 102),$
TYPE=DATA, COLUMN=Z10000, JUSTIFY=CENTER, $
ENDSTYLE
END

Is there any reason why you need to use "A10000" and "A20000" as column's name ?


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
May 05, 2017, 12:01 PM
Dev
Columns are coming from DB and we taking it dynamically.
Like converting Rows to columns...


8202, 8105M, 7.7.03
May 05, 2017, 12:15 PM
Dev
quote:
N

Every thing taking dynamically, so we couldn't take COLUMN=n1.
Let me try to find out the data which are start with A....(with numeric) in DB and to replace as other letter...


8202, 8105M, 7.7.03
May 05, 2017, 01:18 PM
j.gross
If TABLE ... STYLE chokes on the DB column name, you can use DEFINE to effectively rename it (assuming DEFINE doesn't choke). Or use a business view.
May 05, 2017, 02:47 PM
Fernando
Does E01, E02, etc. work?

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
May 05, 2017, 03:10 PM
jcannavo
quote:
Does E01, E02, etc. work?


If I use E10000 and E20000 it works. Perhaps a combo of the previous two replies. Do the initial HOLD using some letter other than A such as I did with the E. Then down the line do a DEFINE setting the value of A10000 to what is held in E10000?


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
May 08, 2017, 07:29 AM
Tony A
One method, if you don't mind building a new synonym on the fly, is to interrogate the contents of the HOLD synonym and then insert your own ALIAS equal to the fieldname prefixed with something (I used "Z_") and then reference the ALIAS in your styling. Then WebFOCUS will not complain Smiler

FILEDEF Z_AMASTER DISK Z_AFORMAT.MAS (APPEND
FILEDEF Z_AFORMAT DISK   AFORMAT.FTM
-RUN

TABLE FILE CAR
BY CAR AS 'A10000'
BY COUNTRY AS 'A20000'
BY SALES
BY MPG
ON TABLE SET ASNAMES ON 
ON TABLE HOLD AS AFORMAT
END
-RUN

TABLE FILE SYSCOLUM
PRINT COMPUTE SYNLINE/A4000 = 'FILENAME='||TBNAME||',SUFFIX='||TBTYPE||',$';
      COMPUTE CRLF/A2       = HEXBYT(13,'A1')||HEXBYT(10,'A1');
      COMPUTE SYNLINE/A4000 = 'SEGNAME='||SEGNAME||',SEGTYPE='||SEGTYPE||LJUST(11,FPRINT(SKEYS,'I11','A11'),'A11')||',$';
   BY LOWEST 1 COLNO NOPRINT
WHERE TBNAME EQ 'aformat'
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS Z_AMASTER
END
-RUN

TABLE FILE SYSCOLUM
PRINT COMPUTE SYNLINE/A4000 = 'FIELD='||NAME||',ALIAS=Z_'||NAME||',USAGE='||USAGE||',ACTUAL='||ACTUAL||',$';
   BY SEGNO NOPRINT
   BY COLNO NOPRINT
WHERE TBNAME EQ 'aformat'
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS Z_AMASTER
END
-RUN

TABLE FILE Z_AFORMAT
BY A10000
BY A20000
BY SALES
ON TABLE SET PAGE NOPAGE
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XLSX 
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,SQUEEZE=ON,ORIENTATION=LANDSCAPE,HEADALIGN = BODY,$
TYPE=REPORT, FONT='ARIAL', SIZE=10, COLOR='BLACK', STYLE=NORMAL, $
TYPE=TITLE,  FONT='ARIAL NARROW', COLOR='WHITE', STYLE=BOLD, JUSTIFY=CENTER, BACKCOLOR=RGB(102 102 102),$
TYPE=DATA, COLUMN=Z_A10000, JUSTIFY=CENTER, COLOR=RED, $
ENDSTYLE
END


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 
May 09, 2017, 06:34 AM
Dev
Thanks to all your reply and suggestions Smiler

I used Tony's way, achieved in different method.

I find the data's which are starting with "A" then am replacing in to another character to load as column and again revert it back for showing the proper title in the same column.

Thanks,
Dev


8202, 8105M, 7.7.03