-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rgba(255 is not a valid value for Int32 #55
Comments
I think you should debug your code closely for the datatable field value(s) if it is ok, the issue may lie there. I have tested using the following code with static HTML string, it works fine and I do not find any issue. See the sample code that I am using:
If you still could not evaluate or find the issue, kindly do provide sample code (runnable) same as above, you may use static string or create dynamic Dataset/datatable in code to remove any inter-dependencies for external data sources to show the issue, so we could execute your code precisely to consequently figure it out soon. |
@amjad-sahi static void Main(string[] args)
{
Workbook wb = new Workbook();
Worksheet ws = wb.Worksheets[0];
Cell cell = ws.Cells["B5"];
cell.HtmlString = "<span style='background-color: rgba(255, 255, 255, 0.8);'>lalalalalala</span>";
wb.Save(@"C:\Users\danvic.wang\Desktop\demo.xlsx");
} |
@Lanesra712 Thanks for the code segment and screenshot with details. After an initial test, I am able to observe the issue as you mentioned by using updated sample code. I found an exception "rgba(255 is not a valid value for Int32" when setting HTML string using rgba color model, it works fine if I use rgb instead:
I have logged a ticket with an id "CELLSNET-46719" for your issue. We will look into it to figure it out soon. It is possible that we will share the fix which may fix your issue. Once we have an update on it, we will let you know. |
@amjad-sahi |
@Lanesra712 This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-46719”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes. |
@ahsaniqbalsidiqui |
@Lanesra712 Your issue should be fixed in it. Let us know your feedback. |
@ahsaniqbalsidiqui |
@Lanesra712 Thanks for the demo project. Please ignore our previous reply as the shared fix does not include your fix in it. We will share a hotfix in the next week (hopefully) which will figure out your issue. Keep in touch. |
@Lanesra712, Please try our latest version/fix: Aspose.Cells for .NET v19.4.6 (attached) Your issue should be fixed in it. Let us know your feedback. |
@amjad-sahi |
@Lanesra712, Good to know that your issue is resolved with the new fix/version. Feel free to contact us any time if you have further queries or issue, we will be happy to assist you soon. |
How i can do specific cell format using coding .please help |
See the following sample code on how to format (apply background color, change font with color and do alignment, etc.) a cell in the worksheet for your reference: //Create a new workbook
Workbook workbook = new Workbook();
//Get the first(default) worksheet in the workbook
Worksheet SheetReport = workbook.Worksheets[0];
//Get the A1 cell
Cell cell = SheetReport.Cells["A1"];
//Insert a value
cell.PutValue("testin..");
// Create and specify style object
Style cellStyle = new CellsFactory().CreateStyle();
cellStyle.HorizontalAlignment = TextAlignmentType.Left;
cellStyle.VerticalAlignment = TextAlignmentType.Center;
cellStyle.Pattern = BackgroundType.Solid;
cellStyle.ForegroundColor = Color.Red;
// Sets Cell style font attributes
cellStyle.Font.Name = "Arial";
cellStyle.Font.IsBold = true;
cellStyle.Font.Size = 12;
cellStyle.Font.Color = Color.Yellow;
// Apply the style to the cell
cell.SetStyle(cellStyle);
//Save the Excel file
workbook.Save("e:\\test2\\out1.xlsx"); Moreover, please see the documents with examples on Format Cells for your complete reference. Should you have further queries or issue, feel free to contact us in dedicated forums. |
Thanks |
How to find range like eg . Range[A5,A10]? |
See the document on managing ranges for your reference. We encourage you to try using our dedicated forums for your further queries or issue. We handle clients queries efficiently in the forums. |
If the numeric data is inserted as string, you will see green triangle saying “Number stored as text” on top left corner of the cell(s). Please note, to apply proper formatting or perform calculations upon the cells, you need to convert these string values (in the cells) to numeric values. Otherwise you will not be able to set your desired tasks. You may use overloaded version of the method, e.g., Cell.PutValue(string stringvalue, bool isConverted) to convert each cells’ existing value (if possible) to numeric values, set the last argument to true. I think you may loop through all those cells in the column and use this overloaded version of the method to convert every possible string value to numeric value (if possible) for the same cell. ...............
cell.PutValue(cell.StringValue, true);
...................... Hope, this helps a bit. |
Thanks amjad-sahi |
You are welcome. |
How to row and column hide? |
You can hide a row or column by using the HideRow and HideColumn methods of the Cells collection respectively. Both methods take the row and column index as a parameter to hide the specific row or column. e.g. // Instantiating a Workbook object
// Opening the Excel file through the filepath
Workbook workbook = new Workbook("Book1.xlsx");
// Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];
// Hiding the 3rd row of the worksheet
worksheet.Cells.HideRow(2);
// Hiding the 2nd column of the worksheet
worksheet.Cells.HideColumn(1);
// Saving the modified Excel file
workbook.Save("out1.xlsx"); Please note, it is also possible to hide a row or column by setting the row height or column width to 0 respectively via relevant API. Moreover, you can show/unhide any hidden row or column by using the UnhideRow and UnhideColumn methods of the Cells collection respectively. Hope, this helps a bit. We again ask you to use our dedicated forums for your queries or issue where we handle clients queries or issues efficiently. |
How to merge A and B column ? I want to used Colspan ,How to use??? |
See the document on merging cells for your reference. Also, see the topic for further reference.
Do you want to set HTML string to the cell, so it should be parsed and cells are merged automatically? If true, you may use Cell.HtmlString attribute to specify your desired HTML string to the cell. If not, kindly elaborate it on how you could implement merging cells in MS Excel manually, you may provide sample Excel file with your desired results. We will check and help you on how to do it via Aspose.Cells APIs. |
I want to put an html string to a workbook cell (with some html element contains rgba in css style) ,and then I use HtmlString, but this operate throw a error about rgba(255 is not a valid value for Int32
The version I have using is Aspose.Cells 19.4.0
The text was updated successfully, but these errors were encountered: