The Combobox is populating data when it should be displaying blank

Support,

We are attempting to render Excel Worksheets to HTML for web viewing. In our testing, we found the comboboxes are populating data when they should be displaying blank values.

I have included a sample Excel document which will allow you to reproduce the issue.

Please use the "Test" worksheet for your testing.


Thank you

Hi Abby,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue. The combo boxes are not rendering in the output html. However, your source xlsm file is password protect and cannot be saved in html using MS-Excel. We need your password to test this issue completely at our end. Please provide the password so that we could investigate this issue further.

Hi Shakeel,

I have e-mailed you the password and titled the subject line as "Password for The Combobox is populating data when it should be displaying blank. The Combobox is populating data when it should be displaying blank."

Thank you,

Hi Abby,

Thanks for your password and using Aspose.Cells.

Please download and use the latest version: Aspose.Cells
for .NET v7.7.1.1
. It gives some different issue. Combo boxes are not displaying at all. I could not observe the issue mentioned by you.

I have attached the output html and screenshot for your reference.

Support,

We used the latest version: Aspose.Cells for .NET v7.7.1.1. and was not able to see the combo boxes. When we convert the shape to an image, the combo boxes populate data when it should be blank.

Here is the sample code we are using:

body { margin: 0 0 0 0; padding:0 0 0 0 } td,div { font-family:Georgia;font-size:9pt;vertical-align:top } body { margin: 0 0 0 0; padding:0 0 0 0; overflow:hidden; } .transcript { background-color:#d2d2d2; } .messageBlock { margin-left:4px; margin-bottom:3px } .message { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; white-space:pre-wrap;} .messageCont { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;white-space:pre-wrap;} .other { overflow:hidden;color:#39577a;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .myself { overflow:hidden;color:#da8103;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .system { margin-left:4px; word-wrap:break-word;color:#da8103;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre;white-space:pre-wrap; } .showTimestamp { padding-left:8px; margin-right:3px; float:right; color:#999999;font-style:normal;font-weight:normal; } .other1 { color:#ac2000;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other2 { color:#3c9fa8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other3 { color:#e25614;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other4 { color:#0b6ac8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other5 { color:#b23290;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other6 { color:#02e7c7;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other7 { color:#5b3284;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .highlight { background-color:#bed6f8; } .datestamp { cursor:default; margin-bottom:1px; background-color:#c0c0c0; width:100%; float:left; text-align:right; color:#ffffff; font-weight:bold; font-style:italic; } #chatAlert { float:left; border-bottom:1px solid #E8D091; padding:6px; width:100%; color:#A5754C; } #chatAlertImage { float:left; } #chatAlertText { float:left; margin-left:6px; } #chatAlertClose { float:right; margin-right:10px; padding-right:6px; margin-top:0px; } #chatAlertText a { color:#A5754C; } #chatAlertText a:hover { color:#A5754C; text-decoration:none; } .tsDisplay { display:block }.dsDisplay { display:none }

var worksheet = workbook.Worksheets[sheetIndex];
var opts = new Cells.Rendering.ImageOrPrintOptions()
{
SmoothingMode = SmoothingMode.HighQuality,
HorizontalResolution = 96,
VerticalResolution = 96,
ImageFormat = ImageFormat.Png,
TextRenderingHint = TextRenderingHint.AntiAlias
};

int ct = worksheet.Shapes.Count;
var indicesToRemove = new List();
for (var y = 0; y < ct; y++)
{
var pic = worksheet.Shapes[y];
var bitmap = pic.ToImage(opts);
if (bitmap == null
|| pic.Width <= 0
|| pic.Height <= 0
|| pic is ComboBox) canRenderAll = false;

if (pic is Cells.Drawing.Picture || bitmap == null) continue;
indicesToRemove.Add(y);
}
}
foreach (var item in indicesToRemove.OrderByDescending(x => x))
{
worksheet.Shapes.RemoveAt(item);
}

body { margin: 0 0 0 0; padding:0 0 0 0 } td,div { font-family:Georgia;font-size:9pt;vertical-align:top } body { margin: 0 0 0 0; padding:0 0 0 0; overflow:hidden; } .transcript { background-color:#d2d2d2; } .messageBlock { margin-left:4px; margin-bottom:3px } .message { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; white-space:pre-wrap;} .messageCont { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;white-space:pre-wrap;} .other { overflow:hidden;color:#39577a;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .myself { overflow:hidden;color:#da8103;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .system { margin-left:4px; word-wrap:break-word;color:#da8103;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre;white-space:pre-wrap; } .showTimestamp { padding-left:8px; margin-right:3px; float:right; color:#999999;font-style:normal;font-weight:normal; } .other1 { color:#ac2000;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other2 { color:#3c9fa8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other3 { color:#e25614;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other4 { color:#0b6ac8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other5 { color:#b23290;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other6 { color:#02e7c7;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other7 { color:#5b3284;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .highlight { background-color:#bed6f8; } .datestamp { cursor:default; margin-bottom:1px; background-color:#c0c0c0; width:100%; float:left; text-align:right; color:#ffffff; font-weight:bold; font-style:italic; } #chatAlert { float:left; border-bottom:1px solid #E8D091; padding:6px; width:100%; color:#A5754C; } #chatAlertImage { float:left; } #chatAlertText { float:left; margin-left:6px; } #chatAlertClose { float:right; margin-right:10px; padding-right:6px; margin-top:0px; } #chatAlertText a { color:#A5754C; } #chatAlertText a:hover { color:#A5754C; text-decoration:none; } .tsDisplay { display:block }.dsDisplay { display:none }

var worksheet = workbook.Worksheets[sheetIndex];
var opts = new Cells.Rendering.ImageOrPrintOptions()
{
SmoothingMode = SmoothingMode.HighQuality,
HorizontalResolution = 96,
VerticalResolution = 96,
ImageFormat = ImageFormat.Png,
TextRenderingHint = TextRenderingHint.AntiAlias
};

int ct = worksheet.Shapes.Count;
var indicesToRemove = new List();
for (var y = 0; y < ct; y++)
{
var pic = worksheet.Shapes[y];
var bitmap = pic.ToImage(opts);
if (bitmap == null
|| pic.Width <= 0
|| pic.Height <= 0
|| pic is ComboBox) canRenderAll = false;

if (pic is Cells.Drawing.Picture || bitmap == null) continue;
indicesToRemove.Add(y);
}
}
foreach (var item in indicesToRemove.OrderByDescending(x => x))
{
worksheet.Shapes.RemoveAt(item);
}

Thank you.

Hi Abby,

Thanks for using Aspose.Cells.

I have converted all of your shapes inside the worksheet “Test” into images and combo boxes is displaying without any data. I have attached the images for your reference. I used the following code for testing.

Please see the combo box images (Document 4.xlsm_10.bmp, Document 4.xlsm_11.bmp)

If your problem still persists, then please provide us your runnable sample project replicating this issue. We will look into it and help you asap.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\Document 4.xlsm”;


Workbook workbook = new Workbook(filePath);


Worksheet worksheet = workbook.Worksheets[“Test”];


int i=0;


foreach (Shape shp in worksheet.Shapes)

{

ImageOrPrintOptions options = new ImageOrPrintOptions();

options.ImageFormat = ImageFormat.Bmp;


shp.ToImage(filePath + “_” + i + “.bmp”, options);

i++;

}