We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Questions about Aspose.Cells

Do you have an email address for support? If so what is your email address for support? I downloaded the Aspose.Cells for Java and we are currently interested in creating XLSX files.

I want the grid lines to display in black lines for the columns and rows area that has data what method or methods would
I need to use for the XLSX file to display black grid lines only in the area of the columns and rows that have data? I tried the
setGridlinesVisible method but that did not do it.

There are a couple of different classes that just have the static final field int and I need to know what is the int value.

Hopefully you have a document somewhere that I will be able to view with all of the int values for your methods that have
an int parameter.

For example you have a PaperSizeType class that has static final int LANDSCAPE and static final int PORTRAIT in my system
environment I have to prototype the Java methods and specify an int value as the parameter I cannot specify LANDSCAPE
or PORTRAIT if I don’t specify an int value for the method I will get a Java signature error message.

Do you have the int values documented somewhere in your Java library?

PageOrientationType

Is the int value correct for the following?
For LANDSCAPE is the int value 0 and PORTRAIT int value a 1?

LANDSCAPE - int = 0
PORTRAIT - int = 1

PaperSizeType

What are the int values for all of your papersizes is there a list somewhere in your Java library? If so give me the link to it.

PAPER_LETTER - int = ?
PAPER_LETTER_SMALL - int = ?

Etc…

BackgroundType

DIAGONAL_CROSSHATCH - int = ?
DIAGONAL_STRIPE - int = ?
GRAY_6 - int = ?

Etc…

TextAlignmentType

BOTTOM - int = ?
CENTER - int = ?
LEFT - int = ?
RIGHT - int = ?

Etc…

My email address is: toshal@drvtech.com


Hi Toshal,


Thank you for considering Aspose APIs, and welcome to Aspose.Cells support forum.

You can use the Style.setBorder method to apply the style to the surrounding borders while switching off the grid lines for any given worksheet. Please check the following piece of code and its resultant spreadsheet as attached. I have documented the source code snippet so that you may tweak it to your requirements. Please also check the detailed article on setting cell borders.

Java

//Create a Workbook
Workbook book = new Workbook();
//Get first Worksheet of the Workbook object
Worksheet sheet = book.getWorksheets().get(0);
//Turn off the visibility of grid lines
sheet.setGridlinesVisible(false);

//Get the instance of first Worksheet cells
Cells cells = sheet.getCells();
//Put some values in different cells
cells.get(“A1”).putValue(“A1”);
cells.get(“A2”).putValue(“A2”);
cells.get(“A3”).putValue(“A3”);
cells.get(“B1”).putValue(“B1”);
cells.get(“B2”).putValue(“B2”);
cells.get(“B3”).putValue(“B3”);
cells.get(“C1”).putValue(“C1”);
cells.get(“C2”).putValue(“C2”);
cells.get(“C3”).putValue(“C4”);

//Dynamically create a Range of cells containing the data
Range range = cells.createRange(“A1”, CellsHelper.columnIndexToName(cells.getMaxDataColumn()) + (cells.getMaxDataRow() + 1));

//Create a new Style object
Style style = book.createStyle();
//Set border property while specifying the border & line type along with color
style.setBorder(BorderType.LEFT_BORDER, CellBorderType.HAIR, Color.getBlack());
style.setBorder(BorderType.RIGHT_BORDER, CellBorderType.HAIR, Color.getBlack());
style.setBorder(BorderType.TOP_BORDER, CellBorderType.HAIR, Color.getBlack());
style.setBorder(BorderType.BOTTOM_BORDER, CellBorderType.HAIR, Color.getBlack());

//Create StyleFlag object and set the border property to true
StyleFlag flag = new StyleFlag();
flag.setBorders(true);

//Apply the style on the range of cells
range.applyStyle(style, flag);

//Save spreadsheet in XLSX format
book.save(“D:/temp/output.xlsx”, SaveFormat.XLSX);

Regarding the other part of your inquiry, you should consult the offline documentation available in the Aspose.Cells for Java package. Once the you extract the aspose-cells-x.x.x-java.zip, please navigate to the doc folder, and render any of three html files in your favorite browser to see the complete API Reference Guide. For instance, PaperSizeType is a class containing the the constants representing the Paper Types available with Aspose.Cells API. You can further explore the dimensions of each paper type by browsing through the documentation.

Please note, all the support matters are handled via support forums therefore we do not need an email address for this purpose. Please feel free to post your inquiries in the relevant forums, and if you are not sure in which forum you should post your concerns, you may post in Aspose.Total support forum.

Hi,


Furthermore, and regarding your requirements as you need the int values (e.g 1,2,3,4,… and so on) for those Constants e.g PaperSizeType, TextAlignmentType etc, well, as we now use the unified document template and tools for JavaDocs, so, there is no such file available to demonstrate the int values for the constants. But, for your specific needs, you may refer to the Aspose.Cells.php file archived in our official release (when you extract the release into some folder, you would get the file from e.g “\JDK 1.5\php” folder at your installation directory). In the header of the .php file, we list all those constants and their respective int values for using those constants. So, we think it will suit your needs. For example, you will find the entry in the header section such as, “define (“PaperSizeType_PAPER_LETTER”,1);”, it means Letter PageSizeType’s relevant int value is “1”. You may scan your desired constants values by browsing into the file for your requirements.

Hope, this helps you a bit.

Thank you.