Hello!
While merging cells in browser I try to export grid to PDF. Result is that the cells are't merged.
Code:
DataTable dt = new DataTable("MyTable");
dt.Columns.Add("index", typeof(int));
dt.Columns.Add("name", typeof(string));
dt.Columns.Add("sex", typeof(bool));
for (int i = 0; i <= 10; i++)
{
dt.Rows.Add(new object[] { i, "Tom" + i, true });
}
this.UltraWebGrid1.DataSource = dt;
this.UltraWebGrid1.Columns.FromKey("sex").MergeCells = true;
Result in browser:
Result in PDF:
Using this component:
Thank you!
Hello Sergey,
Cell merging is supported by the excel engine:
http://help.infragistics.com/NetAdvantage/ASPNET/2010.3?page=ExcelEngine_Merge_Cells.html
but UltraWebGridDocumentExporter currently does not support this.
I recommend you creating new feature request regarding this:
http://devcenter.infragistics.com/Protected/RequestFeature.aspx
Let me know if you need further assistance regarding this.
Hello
When combining the values of the entire column can not export to PDF using UltraWebGridDocumentExporter the same form as that obtained in the browser.
Normal 0 false false false
View in browser:
I'm trying to export the grid into PDF through ISection.This is a part of code, that is responsible for the output table body:
foreach (UltraGridRow curRow in ultraWebGrid.Rows)
IGridRow gridRow = grid.AddRow();
foreach (UltraGridColumn curColumn in ultraWebGrid.Bands[0].Columns)
IGridColumn gridColumn = grid.AddColumn();
gridColumn.Width = new RelativeWidth(10);
IGridCell gridCell = gridRow.AddCell();
gridCell.Borders = cellBorders;
gridCell.AddText().AddContent(ultraWebGrid.Rows[curRow.Index].Cells[curColumn.Index].ToString());
But this code does not allow to export this table in PDF. How do I know whether the current cell is merged with a neighboring in a column? Knowing this attribute I can repeat the same association in my PDF.
Thank you
Thank you for the update.
By default there is property RowSpan
http://help.infragistics.com/NetAdvantage/ASPNET/2010.3/CLR4.0/?page=Infragistics4.WebUI.UltraWebGrid.v10.3~Infragistics.WebUI.UltraWebGrid.UltraGridCell~RowSpan.html
But in case that MergeCells is used the grid automatically merges adjacent cells within the same column that have the same value.
On the client you can get the row span by getting
var rowSpan = r.getCellFromKey("Region").getElement().rowSpan;
http://forums.infragistics.com/forums/p/53016/275840.aspx#275840
On the server you shoul iterate through the cells in the column and manually check if there are equals.
You can set the RowSpan of the report cell :
gridCell = gridRow.AddCell();
gridCell.RowSpan = 2;