|
|
Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Last post 03-26-2010, 8:52 AM by vidvin. 19 replies.
-
02-01-2010, 4:40 PM |
|
|
Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Attachment: Present (inaccessible)
Hi there, I'm using Aspose.Cells 4.8.1.7. I'm trying to put HTML content into particular cells. Or rather formatted content. Some background, my client would like to be able to post formatted content into Excel cells.
Your API has a great feature that lets you retrieve cell content as formatted content. It returns it styled with inline HTML styling. That's great. That's the Cell.HtmlString property.
But what I would love to be able to do is then do the reverse - take the same Cell.HtmlString, or some other arbitrary HTML string, and plop it back into Excel.
See attachments for details. Do you think this would be feasible for you to implement anytime soon?
Thanks Shan
|
|
-
02-02-2010, 12:52 AM |
|
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Hi,
Thank you for considering Aspose.
Well, your requested feature is not supported at the moment. We have already registered this feature in our internal issue tracking system for implementation in future with issue id CELLSNET-6868. As it is a complex feature, so it may not be implemented / released soon. You may try to use the cell.Characters API to format the cell data. Please see the following sample code in this regard:
//Instantiating an Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[0];
//Accessing the "A1" cell from the worksheet
Aspose.Cells.Cell cell = worksheet.Cells["A1"];
//Adding some value to the "A1" cell
cell.PutValue("Rich Text Formatting Demo");
cell.Characters(3, 15).Font.IsItalic = true;
cell.Characters(5, 4).Font.Name = "Algerian";
cell.Characters(21, 4).Font.Color = Color.Red;
//Saving the Excel file
workbook.Save("C:\\testing123.xls");
Thank You & Best Regards,
Nausherwan Aslam Support Developer, Aspose Sialkot Team Contact Us
|
|
-
02-02-2010, 6:41 AM |
-
HVSDev
-
-
-
Joined on 04-27-2008
-
-
Posts 53
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Thanks Nausherwan, have others requested this type of feature before? If so or not, what do you think would realistically be your timing for incorporating this feature into your library?
Thanks Shan
|
|
-
02-02-2010, 7:08 AM |
-
Amjad Sahi
-
-
-
Joined on 08-30-2006
-
-
Posts 18,411
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Hi Shan, Yes, some other users also demanded this feature before. The feature is included in our work list document. We will analyze and check if we can provide you an eta for the feature. Thank you.
Amjad Sahi Support Developer, Aspose Sialkot Team Contact Us
|
|
-
02-05-2010, 4:12 AM |
-
Amjad Sahi
-
-
-
Joined on 08-30-2006
-
-
Posts 18,411
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Attachment: Present (inaccessible)
Hi, Please try the attached fix. We have supported to set html string value as the cell value. Kindly try the version.
Here is sample line of code.
cells["A1"].HtmlString = cells["B2"].HtmlString;
Thank you.
Amjad Sahi Support Developer, Aspose Sialkot Team Contact Us
|
|
-
02-08-2010, 12:15 PM |
-
HVSDev
-
-
-
Joined on 04-27-2008
-
-
Posts 53
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Amjad I just tried out, it works in the sense that it now inserts content into the cell as HTML, but it doesn't seem to preserve the formatting of the text, such as colours, underlines, etc.
I.e. if I paste this in: <font style="font-family: Times New Roman; font-size: 11pt; color: rgb(0, 128, 0);">[ONLY USE IF SIGNIFICANT CHANGE HAS OCCURRED; OTHERWISE, </font><font style="text-decoration: underline; font-family: Times New Roman; font-size: 11pt; color: rgb(0, 128, 0);">DELETE</font><font style="font-family: Times New Roman; font-size: 11pt; color: rgb(0, 128, 0);"> CONTENTS OF CELL] </font><font style="font-family: Times New Roman; font-size: 11pt; color: rgb(0, 0, 255);">The decline/increase in passenger traffic shown by the most recent year-to-date data can be attributed in large part to ....</font><font style="font-family: Times New Roman; font-size: 11pt; color: rgb(0, 128, 0);"> [SF/NY offices add:] </font><font style="font-family: Times New Roman; font-size: 11pt; color: rgb(0, 0, 255);">As of Month 20XX, this airport facility was served by XX airlines, offering daily flights to XX destinations; at the same time last year, the facility was served by XX airlines and offered XX flights daily.</font>
Export the test Excel and open, the cell contains the text but not formatting. If I save in .xlsx format, and open, I see this Office XML which looks like just the font name and size are brought in, which dont' quite appear to be correct:
<si> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> − <t xml:space="preserve"> [ONLY USE IF SIGNIFICANT CHANGE HAS OCCURRED; OTHERWISE, </t> </r> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> <t>DELETE</t> </r> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> <t xml:space="preserve"> CONTENTS OF CELL] </t> </r> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> − <t> The decline/increase in passenger traffic shown by the most recent year-to-date data can be attributed in large part to .... </t> </r> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> <t xml:space="preserve"> [SF/NY offices add:] </t> </r> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> − <t> As of Month 20XX, this airport facility was served by XX airlines, offering daily flights to XX destinations; at the same time last year, the facility was served by XX airlines and offered XX flights daily. </t> </r> </si>
|
|
-
02-08-2010, 12:15 PM |
-
HVSDev
-
-
-
Joined on 04-27-2008
-
-
Posts 53
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Amjad I just tried out, it works in the sense that it now inserts content into the cell as HTML, but it doesn't seem to preserve the formatting of the text, such as colours, underlines, etc.
I.e. if I paste this in: <font style="font-family: Times New Roman; font-size: 11pt; color: rgb(0, 128, 0);">[ONLY USE IF SIGNIFICANT CHANGE HAS OCCURRED; OTHERWISE, </font><font style="text-decoration: underline; font-family: Times New Roman; font-size: 11pt; color: rgb(0, 128, 0);">DELETE</font><font style="font-family: Times New Roman; font-size: 11pt; color: rgb(0, 128, 0);"> CONTENTS OF CELL] </font><font style="font-family: Times New Roman; font-size: 11pt; color: rgb(0, 0, 255);">The decline/increase in passenger traffic shown by the most recent year-to-date data can be attributed in large part to ....</font><font style="font-family: Times New Roman; font-size: 11pt; color: rgb(0, 128, 0);"> [SF/NY offices add:] </font><font style="font-family: Times New Roman; font-size: 11pt; color: rgb(0, 0, 255);">As of Month 20XX, this airport facility was served by XX airlines, offering daily flights to XX destinations; at the same time last year, the facility was served by XX airlines and offered XX flights daily.</font>
Export the test Excel and open, the cell contains the text but not formatting. If I save in .xlsx format, and open, I see this Office XML which looks like just the font name and size are brought in, which dont' quite appear to be correct:
<si> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> − <t xml:space="preserve"> [ONLY USE IF SIGNIFICANT CHANGE HAS OCCURRED; OTHERWISE, </t> </r> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> <t>DELETE</t> </r> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> <t xml:space="preserve"> CONTENTS OF CELL] </t> </r> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> − <t> The decline/increase in passenger traffic shown by the most recent year-to-date data can be attributed in large part to .... </t> </r> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> <t xml:space="preserve"> [SF/NY offices add:] </t> </r> − <r> − <rPr> <sz val="10"/> <rFont val="Arial"/> </rPr> − <t> As of Month 20XX, this airport facility was served by XX airlines, offering daily flights to XX destinations; at the same time last year, the facility was served by XX airlines and offered XX flights daily. </t> </r> </si>
|
|
-
02-08-2010, 1:10 PM |
-
Amjad Sahi
-
-
-
Joined on 08-30-2006
-
-
Posts 18,411
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Hi, Thanks for your feedback, We will look into it and get back to you soon. Thank you.
Amjad Sahi Support Developer, Aspose Sialkot Team Contact Us
|
|
-
02-09-2010, 3:11 AM |
-
Amjad Sahi
-
-
-
Joined on 08-30-2006
-
-
Posts 18,411
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Hi, We will fix it soon. We will inform you when it is sorted out. Thank you.
Amjad Sahi Support Developer, Aspose Sialkot Team Contact Us
|
|
-
02-11-2010, 1:24 AM |
|
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Attachment: Present (inaccessible)
Hi,
Thank you for considering Aspose.
Please try the attached latest version of Aspose.Cells. We have fixed your mentioned issue.
Thank You & Best Regards,
Nausherwan Aslam Support Developer, Aspose Sialkot Team Contact Us
|
|
-
02-11-2010, 12:29 PM |
-
HVSDev
-
-
-
Joined on 04-27-2008
-
-
Posts 53
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
So far what I'm seeing looks great. The content seemed to be inserted with a high level of accuracy with some initial tests.
Thx! Shan
|
|
-
03-04-2010, 10:50 PM |
-
Lama
-
-
-
Joined on 07-30-2008
-
-
Posts 19
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Hi, I am in need of embedding html content in cells and have tried the 4.8.2.6 version of the dll. I find that though some colors and fonts work, some common html tags such as <br /> don't quite work as expected. Could you please tell me what level of html support (i.e. html versions) does ASPOSE intends to provide in the Cells component?
Thanks, lama
|
|
-
03-05-2010, 1:29 AM |
-
Amjad Sahi
-
-
-
Joined on 08-30-2006
-
-
Posts 18,411
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Hi, We support <Font Style=""></Font> and other html attributes e.g, <B>,<I>,<U>,<S>,<STRIKE>,<SUP>,<SUB> For your requirement, we will support <BR> We have logged it into our issue tracking system with an issue id: CELLSNET-14885. Thank you.
Amjad Sahi Support Developer, Aspose Sialkot Team Contact Us
|
|
-
03-12-2010, 4:15 AM |
|
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Attachment: Present (inaccessible)
Hi,
Please try the attached latest version of Aspose.Cells. We have supported <BR> as per your requirement.
Thank You & Best Regards,
Nausherwan Aslam Support Developer, Aspose Sialkot Team Contact Us
|
|
-
03-25-2010, 10:45 AM |
-
vidvin
-
-
-
Joined on 03-25-2010
-
-
Posts 3
-
-
-
-
-
|
Re: Aspose.Cells..PutValue() and HTML content - any way that I can put HTML content in with PutValue?
Hi,
I used the latest attachment here as I have a similar requirement. However, the html content that I am trying to export to excel is something like this:
<span style="font-weight: bold; color: #0066cc; background-color: #99cc00">
Is this supported?
Thanks, Vid
|
|
Page 1 of 2 (20 items)
1
|
|