I have three formatting issues:
- Some of my cells contain "<br/>", it displays two rows in the grid as expected, when I import it to PDF, it displays the string "<br/>" . I have tried to use UltraWebGridDocumentExporter.InitializeRow and UltraWebGridDocumentExporter.RowExporting to replace HTML tag with vbNewLine. The PDF document now as two lines but my grid show eveything in one, as if that function is run on grid.load and not when the export fires.
- My grid has a calculated footer with format set to "C", same as some of my columns. When exporting to PDF columns display value properly $0.00 but not the footer: %240.00
-How do I justify or center the header?
Hi,
For issues 1 and 2 please submit them to Developer Support. I suspect that you are experiencing unintended behavior.
Issue number 3 can be handled in the following fashion:
object sender,
{
}
So, in other words, you handle the HeaderCellExporting event and within this event handler, you can access the ITableCell representation of the Header as it will be created on your exported document.
I am testing to ensure that the e.ReportCell property is not null and if it is not, then I create a new instance of a ContentAlignment object and set it to the Alignment property of e.ReportCell. I then set the Alignment.Horizontal property to Alignment.Center.
The following API documentation displays the ITableCell members for your reference:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Infragistics2.Documents.v8.1~Infragistics.Documents.Report.Table.ITableCell_members.html
In fact i am exporting my grid to pdf and in header i am adding a grid to add some custom report information.
i want to set horizontal alignment for the cells of this grid to right but this is not working
Here is my grid code, I write this in BeginExport event
RT.Style sty = new Infragistics.Documents.Report.Text.Style(new Infragistics.Documents.Graphics.Font("Arial", 10), Infragistics.Documents.Graphics.Brushes.Black); RT.Style sty2 = new Infragistics.Documents.Report.Text.Style(new Infragistics.Documents.Graphics.Font("Arial", 11, Infragistics.Documents.Graphics.FontStyle.Bold), Infragistics.Documents.Graphics.Brushes.Black); RT.Style styTot = new Infragistics.Documents.Report.Text.Style(new Infragistics.Documents.Graphics.Font("Arial", 10, Infragistics.Documents.Graphics.FontStyle.Bold), Infragistics.Documents.Graphics.Brushes.Black); Infragistics.Documents.Report.Section.ISectionHeader header = e.Section.AddHeader(); header.Height = 100; Infragistics.Documents.Report.Text.IText it2 = header.AddText(0, 0); string str2 = ""; str2 = "Good Morning"; str2 += "\nMt PDF Report"; str2 += "\nFrom: 01/01/2008 To: 01/05/2008"; it2.AddContent(str2, sty2); Infragistics.Documents.Report.Grid.IGrid grid = header.AddGrid(305, 0); grid.Borders.Corners.All = new Infragistics.Documents.Report.Corner(Infragistics.Documents.Graphics.Pens.SlateGray, Infragistics.Documents.Utils.Converter.PixelsToPoints(2)); grid.Borders.All = new Infragistics.Documents.Report.Border(Infragistics.Documents.Graphics.Pens.SlateGray); grid.Margins.All = Infragistics.Documents.Utils.Converter.PixelsToPoints(10); grid.Paddings.All = Infragistics.Documents.Utils.Converter.PixelsToPoints(10); grid.Width = new Infragistics.Documents.Report.FixedWidth(200); IGridColumn labels = grid.AddColumn(); IGridColumn data = grid.AddColumn(); IGridRow irow = grid.AddRow(); //To add a row in grid IGridCell cell = irow.AddCell(); //To add a cell in row cell.Paddings.All = Infragistics.Documents.Utils.Converter.PixelsToPoints(3); cell.AddText().AddContent("Paid", sty); //For Column Name //cell.Alignment.Horizontal = Infragistics.Documents.Report.Alignment.Center; cell.Alignment = new Infragistics.Documents.Report.ContentAlignment(); cell.Alignment.Horizontal = Alignment.Right; cell = irow.AddCell(); cell.Paddings.All = Infragistics.Documents.Utils.Converter.PixelsToPoints(3); cell.AddText().AddContent("$ 250.00", sty); cell.Alignment.Horizontal = Infragistics.Documents.Report.Alignment.Right; IGridRow rowCP = grid.AddRow(); //To add a row in grid IGridCell cellCP = rowCP.AddCell(); //To add a cell in row cellCP.Paddings.All = Infragistics.Documents.Utils.Converter.PixelsToPoints(3); cellCP.AddText().AddContent("Credit Payment", sty); //For Column Name cellCP.Alignment.Horizontal = Infragistics.Documents.Report.Alignment.Right; cellCP = rowCP.AddCell(); cellCP.Paddings.All = Infragistics.Documents.Utils.Converter.PixelsToPoints(3); cellCP.AddText().AddContent("$ 1525.25", sty); cellCP.Alignment.Horizontal = Infragistics.Documents.Report.Alignment.Right;
and then in footer of my grid there is sum of column with $ sign this is converted to %24 is this a bug of document exporter
it seems that Document exporter is not working in right way, and i am sure Tom Puglisi must have some idea to solve this problem please help me