57
Views
7
Comments
Solved
[Advanced Excel] Conditional Formatting - Font underline cannot be turned off
advanced-excel
Service icon
Forge asset by Carlos Freitas
Application Type
Service

Hello, can anyone please help me? I have this problem about Conditional Formatting. 

I need to change some cells color based on a rule (i haven't decided it yet). The color changed without any problem, but the cell's underline-style is always set to "1" (Single), even when I set the value to "0" (None). How to turn the underline off?

Here are some screenshots of my settings and result




*I already tested the "ConditionalFormatting_AddRule" without setting any "style" on the "server action" (except address(value:"A1"), formula (value:0), and RuleType(value:30)). Then, the underline is still there.

Thank you for the responses.

2023-05-08 05-34-05
Piyali Saha
Solution

Hello Nicholas,

If you set the underline property to 0 then the underline will not reflect in the excel sheet. Kindly validate if your advanced excel component version is latest or not. 

If the issue still persist please share your oml. And if you need demo regarding conditional formatting, you can go through this component.

Thank and Regards,

Piyali Saha

UserImage.jpg
Ken Hamasaki

Hi Piyali,

Thank you for your response and suggestions.

I encountered the same issue with the underline property not reflecting in the Excel sheet, and in my search for a solution, I found this forum thread. I have checked the latest version of the Advanced Excel component, but unfortunately, the issue persists.

Additionally, I tested the Advanced Excel demo available on Forge, and I observed the same behavior there as well.

Could you please advise if there are any other solutions or workarounds for this issue?

Thank you for your assistance.

Best regards,

Ken Hamasaki

2023-05-08 05-34-05
Piyali Saha

Hi Ken Hamasaki,

I have reviewed the code and confirmed that the issue with underlining text occurs when using the ConditionalFormatting_AddRule method from the component. This behavior stems from how the underline style is currently being handled, and it appears to be a known limitation that the component team may plans to address in an upcoming version update.

If you need a quick fix in the meantime, you can apply the following change directly to the component code:

  1. Open the component solution in Visual Studio.

  2. Locate the Util.cs file.

  3. Inside the ApplyConditionalFormattingStyle method, update the handling of the underline style as follows:

if (ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssUnderline == 0)

{

    style.Font.Underline = null;

}

else

{

    style.Font.Underline = (ExcelUnderLineType)ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssUnderline;

}

Please let me know if you require more inputs from my side. 

Best Regards,

Piyali


UserImage.jpg
Ken Hamasaki


Dear Piyali,

Thank you for your prompt and detailed response regarding the issue with the underline style in the component. I appreciate your guidance on how to apply a quick fix directly to the component code.

Could you please let me know if there is an estimated timeline for the upcoming version update that might address this limitation?

In the meantime, I will try implementing the suggested changes to the component.

Thank you once again for your assistance.

Best regards,

Ken Hamasaki

2023-05-08 05-34-05
Piyali Saha

Hi Ken Hamasaki, 

Regarding the upcoming version update, the component team leading its development would be the best source for any updates. At this moment, I do not have specific information on the release timeline.

In the meantime, I hope the provided workaround helps address the issue in your current scenario. Let me know if you need any further assistance.

Best Regards,

Piyali


UserImage.jpg
Ken Hamasaki


Dear Piyali,

Thank you very much for your support.

I installed the latest version of Integration Studio and appended the code you provided to the end of the ApplyConditionalFormattingStyle method in Utils.cs.

However, unfortunately, I encountered a compilation error and was unable to publish the extension successfully.

Could you kindly let me know the version of Integration Studio you are using, as well as the detailed steps you took to apply the fix?

I sincerely appreciate your time and support. Thank you in advance for your kind assistance.

Best regards,

Ken Hamasaki

2023-05-08 05-34-05
Piyali Saha


Hi Ken Hamasaki, 

  • Open the Component in Visual Studio

    • Navigate to the folder where your OutSystems extension is stored.

    • Open the .csproj file using Visual Studio.

  • Locate the Util.cs File

    • In the Solution Explorer, find and open the Util.cs file.

  • Search for the Keyword Underline

    • Use Ctrl + F (Find) to search for the keyword Underline.

    • Locate the line of code that looks like:

      style.Font.Underline = null;

  • Replace the Line with the Fix

    • Replace the above line with the updated code you were provided:

      if (ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssUnderline == 0){    style.Font.Underline = null;}else{    style.Font.Underline = (ExcelUnderLineType)ssStyle.ssSTConditionalFormatStyle.ssFont.ssSTFontStyle.ssUnderline;}

  • Build or Rebuild the Project

    • In Visual Studio, go to the Build menu and choose Build Solution or Rebuild Solution to compile the updated component.

  • Publish the Updated Extension

    • Click on the "1-Click Publish" button to publish the updated extension to your OutSystems environment.

  • Refresh Dependencies in Service Studio

    • Open your OutSystems application in Service Studio.

    • Go to Manage Dependencies.

    • Locate your extension and click Refresh to ensure the latest version is used.

  • Run the Application in the Browser

    • After refreshing the dependencies, publish your application.

    • Click "Open in Browser" or run the module to verify that the underline behavior has been fixed in Excel exports.


The version I am using of integration studio is 11.14.24. Please let me know if this worked for you.

Regards,

Piyali

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.