Skip to content
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

Formula attribute added to support in rows with dto or dynamic attrib… #679

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

RaZer0k
Copy link
Contributor

@RaZer0k RaZer0k commented Oct 11, 2024

I added the support of formula rows values... i tested with =hyperlink("") without problems.
You can add the parameter "Type = ColumnType.Formula" into the DTO or create a dynamic columns setting with the "Type
= ColumnType.Formula" parameter.

var dColumns = new[]
{
    new DynamicExcelColumn("Url")
    {
        Width = 100,
        Type = ColumnType.Formula
    }
};

var config = new OpenXmlConfiguration
{
    TableStyles = TableStyles.None,
    AutoFilter = false,
    DynamicColumns = dColumns
};

MiniExcel.SaveAs(stream, _sheets, configuration: config);

Or

[ExcelColumn(Name = "Url Document", Type = ColumnType.Formula, Width = 16)] public string Url { get; set; }

Adding this column to use formula:

row.Add("Url", $"=HYPERLINK(\"{doc.Url ?? ""}\")");

Update: Added enum type for the new Type parameter

@shps951023 shps951023 merged commit f0fe803 into mini-software:master Oct 15, 2024
2 checks passed
@shps951023
Copy link
Member

@RaZer0k ❤❤❤ Could we invite you to our team?

@RaZer0k
Copy link
Contributor Author

RaZer0k commented Oct 15, 2024

it would be a pleasure for me

@simon-reynolds
Copy link

Hi, is there any ETA on when this will be released to NuGet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants