Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all 1877 articles
Browse latest View live

Created Unassigned: font for arabic/persian language [9380]

$
0
0
Hi

im trying to set font for Persian language but it seems it dose not work

when i download my excel file , the cell that i set the font is not changed but when i click on it the font name has been changed.

thank you if you help me how can i solve this problem.

here is my code and i also attached the font

Dim doc = New XLWorkbook()
Dim sheet = doc.AddWorksheet("Some Title")
sheet.Cell(1,1).Style.Font.FontName="B Nazanin"

sheet.Rows().AdjustToContents()
sheet.Columns().AdjustToContents()
doc.SaveAs("c:\temp.xlsx")




New Comment on "Styles - Border"

$
0
0
How to bold part of string like: Test date <B>1/1/2014</B>?

New Post: Double foreach

$
0
0
Hi I am new to ClosedXML

I have the following:
. worksheet.Cell ("A2") = Value Report.GetDato (Id);

This is correct, but from column D, I have a foreach, the result is similiar to the next.
one, two, three, four.

All this appears to me within the column D

With ClosedXML as I can get each result appears in a different column?

Like this:
D E F G
one two three four


Thank you very much.

New Post: Double foreach

$
0
0
I have no clue what you're trying to say. Give a piece of code that reproduces the problem.

New Post: Double foreach

$
0
0
This is the code:


List<ReportArgs > list = new List<ReportArgs >();
List<Persons> persons = DB.Persons.AsNoTracking().AsParallel().OrderBy(o => o.IdPerson).ToList();
var Cars= DB.PersonCars.AsNoTracking().ToList().AsReadOnly();
               foreach (var item in persons )
                {

                    ReportArgs report= new ReportArgs();

                   report.Name = item.Name;
                   report.SeconName = item.SeconName;
                   report.Age = item.Age;

                foreach (var itm in Cars.Where(x => x.IdPerson == item.Idperson).ToList())
                    {
                        report.Cars  += itm.MatriculaAsociada.ToString();

                    }

                    list .Add(report);
                }
I have the following:

worksheet.Cell ("A2") = Value Report.GetDato(Id);

Once the report is presented gives me the following result

COLUMN A, COLUMN B COLUMN C COLUMNA D
Michael Robert 26 cared caryellow, carblue

But I need it to appear like this:

COLUMN A, COLUMN B COLUMN C COLUMNA D COLUMN E COLUMNA F
Michael Robert 26 carred caryellow carblue

Thanks.

New Post: Double foreach

$
0
0
Still no clue if there's a bug or not but it seems like you need to create the table yourself instead of passing that collection to a cell.

New Post: Double foreach

$
0
0
Exactly need to pass the collection to a table because the displays into a single cell

New Post: Is Excel sheet support HTML formatting?

$
0
0
Hi,

So, it is supposed to parser the HTML and after that how can I export that text to excel showing it properly?
I tried just converting the text to excel and it put everything on one cell, I would need the text justified or something more appropriate for text, most of the examples are about data tables and just records in general.

Thank you in advance.

New Post: Is Excel sheet support HTML formatting?

$
0
0
You have to parse the HTML and insert the data in the appropriate cells.

New Post: Change header of table

$
0
0
There is still the problem. Also other user were able to reproduce this bug/problem. Any suggestion?

Created Unassigned: Locking cells doesn't work [9381]

$
0
0
Hello,

Looks like Worksheet.Cell(i,j).Style.Protection.Locked = true does not work like intended and the field is still editable. Is there something I am missing?

Thanks

Closed Unassigned: Locking cells doesn't work [9381]

$
0
0
Hello,

Looks like Worksheet.Cell(i,j).Style.Protection.Locked = true does not work like intended and the field is still editable. Is there something I am missing?

Thanks
Comments: That's standard Excel functionality. Locking cells or hiding formulas has no effect until you protect the worksheet.

New Post: Change header of table

$
0
0
Your example works. Pick the source code and not the release.

Created Unassigned: Addition of PX as a knownUnit in XLWorkSheet_Load.cs [9382]

$
0
0

I came across an Excel file (I think from 2003 originally and re-saved as MS Office 2013 XLSX) which hit the GetPtValue private method in the XLWorksheet_Load.cs file and the string was "62px". As "px" is not in the knownUnits dictionary this progressed on to fail with a Double parse error.

Can I suggest:

1) Add "px" with an averagely acceptable conversion factor of 1.3 (it actually varies depending on user screen resolution - but I can't see it being of any benefit to react to that).

private readonly Dictionary<string, double> knownUnits = new Dictionary<string, double>
{
{"pt", 1.0},
{"in", 72.0},
{"mm", 72.0/25.4},
{"px", 1.3333333}
};

2) Handle the Double parse in GetPtValue with a Try Parse and default some nominal value . It may mean after resaving some positioning is complete wrong, but this seems better than failing to an exception.


Good work! Keep it up.

Commented Unassigned: Locking cells doesn't work [9381]

$
0
0
Hello,

Looks like Worksheet.Cell(i,j).Style.Protection.Locked = true does not work like intended and the field is still editable. Is there something I am missing?

Thanks
Comments: Thanks MDeLeon for your prompt answer. But if I do protect the entire worksheet all the cells become locked, I only want a select number of them to be locked.

Commented Unassigned: Locking cells doesn't work [9381]

$
0
0
Hello,

Looks like Worksheet.Cell(i,j).Style.Protection.Locked = true does not work like intended and the field is still editable. Is there something I am missing?

Thanks
Comments: The same way you would do it in Excel. Unlock the entire worksheet and then lock individual cells. worksheet.Protect(); worksheet.Style.Protection.Locked = false; worksheet.Cell("A1").Style.Protection.Locked = true;

Commented Unassigned: Locking cells doesn't work [9381]

$
0
0
Hello,

Looks like Worksheet.Cell(i,j).Style.Protection.Locked = true does not work like intended and the field is still editable. Is there something I am missing?

Thanks
Comments: Thanks a lot man. I appreciate it!

Created Unassigned: Changing a Column Header's text [9383]

$
0
0
I am trying to change the text of cells in the first row of the spreadsheet, essentially the column header.

This example is just changing the first cell in row 1.

```
Dim l_sValue As String
l_sValue = "test"
wb.Worksheets(0).Cell(1, 1).DataType = XLCellValues.Text
wb.Worksheets(0).Cell(1, 1).Value = l_sValue
```

However, when I do this the spreadsheet needs to be repaired when I open it. If I change any cell other than a cell in row 1 I have no issues.

I need to modify the column headers so they have a better meaning and can't do this in the DataTable that I am importing from.

New Post: Change header of table

New Post: Adding formula results save prompt when excel file is closed

$
0
0
I just added the following line in my .net application:
ws.Cell(3, 5).FormulaR1C1 = "RC[-1] - RC[-2]";
Formula works as expected when I open resulting excel file. But when I click close button excel asks me to save changes. How to avoid this prompt? I upgraded to DocumentFormat.OpenXml 2.5 and ClosedXML 0.75; the issue still remains.
Viewing all 1877 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>