Reply to topic  [ 2 posts ] 
EasyXLS for VB 6 Query 
Author Message

Joined: Wed May 24, 2023 1:00 am
Posts: 6
Reply with quote
Post EasyXLS for VB 6 Query
I have Following Query for EasyXLS for VB 6

Query 1

Dim varValue As Double
varValue = 0.487281089615732

xlsFirstTable.easy_getCell(2, 2).setValue varValue
xlsFirstTable.easy_getCell(2, 2).setFormat ("0.00%")
xlsFirstTable.easy_getCell(2, 2).setDataType ("numeric")

This Shows the Value as "48.73%" but inside the Cell it Shows 48.7281089615732%

How can I shoes inside the Cell as "48.73%"

Query 2

xlsFirstTable.easy_getCell(2, 2).setValue varValue
xlsFirstTable.easy_getCell(2, 2).setFormat ("#0.00")
xlsFirstTable.easy_getCell(2, 2).setDataType ("numeric")

Current Output
varValue = 5.01. This Gives the Output 5.01
varValue = 5.1 This Gives the Output 5.10
varValue = 5 This Gives the Output 5.00
varValue = 0 This Gives the Output 0.00

Output Required
varValue = 5.01. Output 5.01
varValue = 5.1 Output 5.1
varValue = 5 Output 5
varValue = 0 Output 0

I have tried various combination like "#.##" or "#.#0" etc... but it is not working

How this can be done ?


Query 3

I have Cell Range as B2 to E6
I want to give the Border as Outline of Entire Range

How can I give the same in the Range Cell Option ?


Query 4

How can I give AutoFit Entire Column ?

I want to have a Width of 8.43 for Column 1 and Rest all I want to AutoFit.


Thanking You

Bhavesh


Fri Jun 09, 2023 9:00 am
Profile

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 197
Location: Brasov, Romania
Reply with quote
Post Re: EasyXLS for VB 6 Query
Query 1
This is the normal behavior in MS Excel. You may try to create a similar cell in MS Excel interface (without using EasyXLS) and you will get the same behavior.

Query 2
This is also the normal result that you get for "#0.00" number format. If you will not set any number format (default "General"), you will see the numbers that you want.

Query 3
You need to define the border for the cells that defines the range:

Code:
//Top left cell
xlsFirstTable.easy_getCell(RowStart, ColumnStart).setBorderStyles(Border.BORDER_MEDIUM, Border.BORDER_NONE,
                               Border.BORDER_MEDIUM, Border.BORDER_NONE);
//Top cells
for (int col=ColumnStart+1; col <ColumnEnd-1; col ++)
{
   xlsFirstTable.easy_getCell(RowStart, col).setBorderStyles(Border.BORDER_MEDIUM, Border.BORDER_NONE,
                               Border.BORDER_NONE, Border.BORDER_NONE);
}


and similar for the top right cell, left cells, bottom left cell, bottom cells, bottom right cell and right cells.
You may find here the available borders:
https://www.easyxls.com/manual/API_Documentation/EasyXLS/Constants/Border.html

Query 4
Autofit is the default option. You can find more details about autofit and custom column width at the following link:
https://www.easyxls.com/manual/basics/excel-column-width-row-height.html

_________________
EasyXLS Team
.NET and Java library to read and write Excel files
Facebook X Reddit LinkedIn


Thu Jun 15, 2023 3:52 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.