Focal Point
[SOLVED] Excel cell shows generic format with Adhoc reports

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

May 08, 2020, 05:38 PM
Sandhya j
[SOLVED] Excel cell shows generic format with Adhoc reports
Hi,

We have a Adhoc report, which shows the columns based on user selection. For this I am just doing the print * to display the user selected columns and data coming from the stored procedure. The problem here is, when users choose date columns for the report, after generating the report user is not able to change the date column formats. It's alwys shown in Generic format and not allowing to customize it in the excel.
The output format of the report is xlsx. I also tried with xls format but still same problem.
As this is a Adhoc report I am not able to put any logic in fex file because date column can come in any order.

?FF SQLOUT is showing the datefield format as A10.

Please advice.

WF version: 8206

Thank You
Sandhya J

This message has been edited. Last edited by: FP Mod Chuck,
May 09, 2020, 07:56 AM
BabakNYC
What’s the format of the date field in the DBMS?


WebFOCUS 8206, Unix, Windows
May 09, 2020, 08:40 PM
Sandhya j
It is store as mainframe date format. SP returns in alpha format.


WEBFOCUS 8202/Windows
PDF/HTML/XML
May 11, 2020, 09:07 AM
BabakNYC
If the SP is returning an Alpha field, WebFOCUS will send it to Excel as an Alpha field as well, unless you convert that field to a date. There are a lot of date conversion functions and depending on what your date field looks like when displayed, you can create a DEFINE to turn it into a real date field.

if your alpha 10 field looks like 2020/05/11 you can use DATECVT function to convert it to a date field. Here's a simple example.

  
-SET &MYDATE='2020/05/11';
DEFINE FILE CAR
NEW_DATE/A8 WITH COUNTRY=EDIT('&MYDATE','9999$99$99');
MY_NEW_DATE/YYMD = DATECVT(NEW_DATE, 'A8YYMD', 'YYMD');
END
TABLE FILE CAR
PRINT MY_NEW_DATE
BY COUNTRY
ON TABLE PCHOLD FORMAT XLSX
END

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


WebFOCUS 8206, Unix, Windows
May 11, 2020, 05:20 PM
Sandhya j
Thank You somuch for the response.
As this is adhoc report, output columns varies, user can select any number of columns and date fields can be in any position to submit the report.
So from fex file I can only do PRINT *. In order to use the DEFINE I have to know the position of date field and it is not fixed position all the time.
Is there other way I can change the format using CHECK FILE HOLD?


WEBFOCUS 8202/Windows
PDF/HTML/XML
May 12, 2020, 11:04 AM
Sandhya j
I resolved my issue. Thanks for your inputs.


WEBFOCUS 8202/Windows
PDF/HTML/XML