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 Sep 25, 2019 4:16 pm

Hi! I have a workbook and I've set wrap text for all sheet.

Here's my code:
Code: Select all
var range = sheet.Range(7, 1, sheet.LastRowUsed().RowNumber(), 19);

            range.Style.Border.SetInsideBorder(XLBorderStyleValues.Thin);
            range.Style.Border.SetOutsideBorder(XLBorderStyleValues.Thin);

            range.Style.Alignment.SetVertical(XLAlignmentVerticalValues.Center);
            range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center);

            range.Style.Alignment.SetWrapText();


90% of cells are right but there's 10% don't.

print.png
print.png (12.75 KiB) Viewed 1716 times


Can you help me?

fjlsantiago
 
Posts: 9
Joined: Wed Sep 25, 2019 4:05 pm

Thu Sep 26, 2019 3:14 am

Hi,

Thanks for your inquiry.
Do you use the latest Spire.XLS Pack(Hotfix) Version:9.9.5? Sorry that I didn't find the method SetWrapText in Spire.XLS. Spire.XLS could use the code "range.IsWrapText = true;" to set wrap text. For your problem, could you please provide your input Excel file and tell us the version you used?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Sep 26, 2019 8:56 am

Betsy.jiang wrote:Hi,

Thanks for your inquiry.
Do you use the latest Spire.XLS Pack(Hotfix) Version:9.9.5? Sorry that I didn't find the method SetWrapText in Spire.XLS. Spire.XLS could use the code "range.IsWrapText = true;" to set wrap text. For your problem, could you please provide your input Excel file and tell us the version you used?

Sincerely,
Betsy
E-iceblue support team


Hi!
I'm using FreeSpire.XLS 9.2.1.

This is an input from a plugin (DHTMLX Scheduler) and when I export to Excel, there's all fine but when I export to PDF there's some cell's that text wrap doesn't work.

Can you help me?

fjlsantiago
 
Posts: 9
Joined: Wed Sep 25, 2019 4:05 pm

Thu Sep 26, 2019 9:40 am

Hi,

Thanks for your response.
Sorry that I still cannot find the method "range.Style.Alignment.SetWrapText()" in free Spire.XLS 9.2 in which the information of Spire.Xls.dll is 9.2.12. Could you please check again?
Besides, I suggest you try to use the latest Spire.XLS Pack(Hotfix) Version:9.9.13 which has more fixes than old version. If you still have the issue, I am afraid we need your input Excel file( you could save from DHTMLX Scheduler and provide for us) to help us reproduce your issue. And if you use different code from the code you provided in previous post, please also share it.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Sep 26, 2019 9:59 am

Betsy.jiang wrote:Hi,

Thanks for your response.
Sorry that I still cannot find the method "range.Style.Alignment.SetWrapText()" in in which the information of Spire.Xls.dll is 9.2.12. Could you please check again?
Besides, I suggest you try to use the latest Spire.XLS Pack(Hotfix) Version:9.9.13 which has more fixes than old version. If you still have the issue, I am afraid we need your input Excel file( you could save from DHTMLX Scheduler and provide for us) to help us reproduce your issue. And if you use different code from the code you provided in previous post, please also share it.

Sincerely,
Betsy
E-iceblue support team


Hi! Sorry for misunderstood and I'm creating the Excel with ClosedXML, and format to PDF with Spire.

I'm downloading and will Upgrade Spire, but the problem are to format for PDF.

There's my code:
Code: Select all
if (format == ExportFormat.pdf)
            {
                // load Excel file
                Spire.Xls.Workbook workbook = new Spire.Xls.Workbook();
                workbook.LoadFromFile(this.newFileName);

                workbook.ConverterSetting.SheetFitToPage = true;
                workbook.Worksheets[0].PageSetup.PaperSize = PaperSizeType.PaperA4;
                workbook.Worksheets[0].PageSetup.Orientation = PageOrientationType.Landscape;
                workbook.Worksheets[0].PageSetup.PrintArea = "";

                // convert Excel to PDF using the template above
                string pdffilename = this.newFileName.Replace(".xlsx", ".pdf");
                workbook.SaveToFile(pdffilename, FileFormat.PDF);

                return pdffilename;
            }

fjlsantiago
 
Posts: 9
Joined: Wed Sep 25, 2019 4:05 pm

Thu Sep 26, 2019 10:14 am

Hi,

Thanks for your fast response.
Could you please provide your Excel file? I am afraid it is difficult for us to locate the reason of your issue without your Excel file. You could upload it here or send to us(support@e-iceblue.com) via email. We promise to keep your document confidential and won't use it for any other purpose.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Sep 26, 2019 10:35 am

Betsy.jiang wrote:Hi,

Thanks for your fast response.
Could you please provide your Excel file? I am afraid it is difficult for us to locate the reason of your issue without your Excel file. You could upload it here or send to us(support@e-iceblue.com) via email. We promise to keep your document confidential and won't use it for any other purpose.

Thanks,
Betsy
E-iceblue support team


There's my Excel! In Excel all rows are fine, It's only problem when you convert.

Thanks a lot
Last edited by fjlsantiago on Mon Oct 07, 2019 10:45 am, edited 1 time in total.

fjlsantiago
 
Posts: 9
Joined: Wed Sep 25, 2019 4:05 pm

Fri Sep 27, 2019 2:36 am

Hi,

Thanks for your file.
After testing your file with the latest Spire.XLS Pack(Hotfix) Version:9.9.13, I didn't notice the issue you mentioned. The result PDF is correct. You could check it in the attachment.
Please use the latest version and try again.

Sincerely,
Betsy
E-iceblue support team
Attachments
result.zip
(78.44 KiB) Downloaded 199 times
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Sep 27, 2019 9:14 am

Betsy.jiang wrote:Hi,

Thanks for your file.
After testing your file with the latest Spire.XLS Pack(Hotfix) Version:9.9.13, I didn't notice the issue you mentioned. The result PDF is correct. You could check it in the attachment.
Please use the latest version and try again.

Sincerely,
Betsy
E-iceblue support team


Could you share with me your ExportFormat function?

Something like a function that i share with you in this post.

fjlsantiago
 
Posts: 9
Joined: Wed Sep 25, 2019 4:05 pm

Fri Sep 27, 2019 9:42 am

Hi,

I used the same code like you provided.
Code: Select all
                 Workbook workbook = new Workbook();
                 workbook.LoadFromFile(FilePath + "example.xlsx");

                 workbook.ConverterSetting.SheetFitToPage = true;
                 workbook.Worksheets[0].PageSetup.PaperSize = PaperSizeType.PaperA4;
                 workbook.Worksheets[0].PageSetup.Orientation = PageOrientationType.Landscape;
                 workbook.Worksheets[0].PageSetup.PrintArea = "";
                 workbook.SaveToFile("result.pdf", FileFormat.PDF);

Do you use the latest version? If you still have the issue after trying the latest version, please provide following information:
1. The output you got
2. The OS and Region information, e.g. Win7 64bit, China/Chinese.

Sincerely,
Betsy
E-iceblue support team

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Sep 27, 2019 11:13 am

Betsy.jiang wrote:Hi,

I used the same code like you provided.
Code: Select all
                 Workbook workbook = new Workbook();
                 workbook.LoadFromFile(FilePath + "example.xlsx");

                 workbook.ConverterSetting.SheetFitToPage = true;
                 workbook.Worksheets[0].PageSetup.PaperSize = PaperSizeType.PaperA4;
                 workbook.Worksheets[0].PageSetup.Orientation = PageOrientationType.Landscape;
                 workbook.Worksheets[0].PageSetup.PrintArea = "";
                 workbook.SaveToFile("result.pdf", FileFormat.PDF);

Do you use the latest version? If you still have the issue after trying the latest version, please provide following information:
1. The output you got
2. The OS and Region information, e.g. Win7 64bit, China/Chinese.

Sincerely,
Betsy
E-iceblue support team

Sincerely,
Betsy
E-iceblue support team


Hi! I've found something. With same code, when I export an Excel file and input that file to my code, the output file has wrap errors.
But when I open the Excel file and save without change nothing and input that file to my code, the output file is perfect!

I've left my input and my output in attachments. Please take a look and tell me anything.

Thanks a lot
Last edited by fjlsantiago on Mon Oct 07, 2019 10:44 am, edited 1 time in total.

fjlsantiago
 
Posts: 9
Joined: Wed Sep 25, 2019 4:05 pm

Sun Sep 29, 2019 3:48 am

Hi,

Thanks for your detailed information.
I have noticed the issue and posted to our Dev team. We will let you know once there is any update.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Sep 30, 2019 8:40 am

Betsy.jiang wrote:Hi,

Thanks for your detailed information.
I have noticed the issue and posted to our Dev team. We will let you know once there is any update.

Sincerely,
Betsy
E-iceblue support team


Thanks a lot.
I'm waiting for news!

fjlsantiago
 
Posts: 9
Joined: Wed Sep 25, 2019 4:05 pm

Mon Sep 30, 2019 9:27 am

Hi,

If there is any update, we will let you know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Oct 07, 2019 10:01 am

Betsy.jiang wrote:Hi,

If there is any update, we will let you know.

Sincerely,
Betsy
E-iceblue support team


Any news?

fjlsantiago
 
Posts: 9
Joined: Wed Sep 25, 2019 4:05 pm

Return to Spire.XLS