I would like to ask you something about formatting cells in excel file (report) throw calling api_datasource.printtoexcel procedure. When I declare columns by v_excelCols_t api_datasource.tt_excelColumns, and when I specify a column, such as (for example): v_excelCols_t(1).datasourceColumnName_tx := 'HIRE_DATE'; v_excelCols_t(1).label_tx := 'HIRE DATE'; v_excelCols_t(1).format_tx :='DD/MM/YYYY'; I want to specify a column by some other attributes, for example, I would like to align column (in fact a cell). How can I do it? And what else can I specify for a column (or cell)?

asked 19 Feb '16, 04:25

ivantg's gravatar image

ivantg
1.0k1
accept rate: 0%


Hi Ivan,

Unfortunately, it's not possible to align the generated Excel cell. Currently, the API is only able to set the date/number format of the cell and the header label of the column. You can find the example script below:

declare
   v_excelCols_t api_datasource.tt_excelColumns;
 begin
   v_excelCols_t(1).datasourceColumnName_tx := 'FIRST_NAME';
   v_excelCols_t(1).label_tx := 'FIRST NAME';

   v_excelCols_t(2).datasourceColumnName_tx := 'SALARY';
   v_excelCols_t(2).label_tx := 'SALARY';
   v_excelCols_t(2).format_tx :='#,###.00#';

   v_excelCols_t(3).datasourceColumnName_tx := 'HIRE_DATE';
   v_excelCols_t(3).label_tx := 'HIRE DATE';
   v_excelCols_t(3).format_tx :='DD/MM/YYYY';

   api_datasource.printtoexcel('EMPLOYEES1', v_excelCols_t, 'N', 'employeesData', api_datasource.FILE_FORMAT_XLSX);
 end;

Best Regards,
Ibrahim

link

answered 19 Feb '16, 07:00

ibrahim's gravatar image

ibrahim ♦♦
48.6k1
accept rate: 0%

Thank you, Ibrahim. I've already saw and implement solution as on the example, but I though maybe there is more applicable characteristics.

link

answered 22 Feb '16, 04:40

ivantg's gravatar image

ivantg
1.0k1
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×3

Asked: 19 Feb '16, 04:25

Seen: 750 times

Last updated: 22 Feb '16, 04:40


© Copyright Gerger 2017