Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Wed Jul 31, 2019 4:37 pm

Hi,

I am unable to remove/hide the grid lines. Can you advise please?

UPDATE: I have noticed that saving to Excel format removes the grid lines but saving to PDF does not. I have even read the Excel file (without gridlines) back in and saved it to PDF and the grid lines are added back so it appears that the SaveToPDF method is actually adding grid lines.

My Code:


Workbook workBook = new Workbook();
workBook.LoadFromFile(excelFileName);

foreach (Worksheet workSheet in workBook.Worksheets)
{
workSheet.GridLinesVisible = false;
workSheet.GridLineColor = ExcelColors.White;
workSheet.SaveToPdf(newFileName);
}

newgui
 
Posts: 5
Joined: Wed Dec 09, 2015 11:03 pm

Thu Aug 01, 2019 6:24 am

Hi,

Thanks for your inquiry. This is Amber from E-iceblue support team.
After an initial test with Spire.XLS Pack Version:9.7, I didn’t reproduce your issue. I am afraid it is difficult for us to locate the reason of your issue if we don’t reproduce it on our side.
To help us better investigate your issue, could you please offer us your input excel file and output pdf file? You could upload your files here or send them to us via email(support@e-iceblue.com).

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Thu Aug 01, 2019 1:19 pm

Thanks for the reply. The documents are attached.
Attachments
InputOutputDocuments.zip
Requested Input and Output Documents
(76.15 KiB) Downloaded 176 times

newgui
 
Posts: 5
Joined: Wed Dec 09, 2015 11:03 pm

Thu Aug 01, 2019 2:30 pm

Update: I figured out what I was doing wrong. I got grids and borders confused. I am able to remove the borders now. However, is there a way to remove the borders globally without having to specify a range?

newgui
 
Posts: 5
Joined: Wed Dec 09, 2015 11:03 pm

Fri Aug 02, 2019 8:15 am

Hi,

Thanks for your information.
You could get all the used cells first then remove the border of them.
Here is my code for your reference.

Code: Select all
            CellRange range = wb.Worksheets[0].AllocatedRange;
            range.BorderNone();


Any question, welcome to contact us.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Mon Aug 12, 2019 3:03 am

Hi,

Greetings from E-iceblue.
Have you tried the code I offered you lasted time? Does it solve your issue?
Could you please give us some feedback at your convenience?

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.XLS

cron