liizz
April 17, 2012, 11:24am
1
Hi all,
I have a report which has a print to Excel functionality. I have a column which is of type text but the text is too long and it is not displaying well.
The output is as such:
and I have used the function FORMAT…
Please help if there are some built-in functions to display the text correctly.
Thanks
Liizz
You have to use
xlWorkSheet.Range(‘A:Z’).Columns.AutoFit;
at the end,before
xlApp.Visible := TRUE;
liizz
April 17, 2012, 12:50pm
3
Only the columns have been fixed according to the text size but still the value of the column is showing
try, export it as
‘’’ + FORMAT(your value); (3 single quotes…)
DaveT
April 17, 2012, 1:23pm
5
Hi Liizz,
How are you exporting to Excel?
If using Excel Buffer then the last argument is the format type e.g.
ExcelBuf.AddColumn(format(MyValue),FALSE,’’,FALSE,FALSE,FALSE,’@’);
where the ‘@’ formats as text in Excel
liizz
April 20, 2012, 9:07am
6
Hi.
Am not using Excel Buffer.
I am using this instead.
xlWorksheet.Range(‘A’+ FORMAT(intRowNo)).Value :=FORMAT(myvalue);
I have also placed this near ‘’’ + 'FORMAT(myvalue) but it is not working.
Please help
Liizz
Did you try with
‘’’ + FORMAT(myvalue)
Try
xlWorksheet.Range(‘A’+ FORMAT(intRowNo)).Value := myvalue;
xlWorksheet.Range(‘A’+ FORMAT(intRowNo)).NumberFormat := “#,##0 .00”;
You can play around wih “#,##.00” and try “##0 ” or “#,##0 ”
xlWorkSheet.Range(‘A’ + FORMAT(ColNo)).NumberFormat:=’#.##0 ,0’;