Hello everybody...
I'm fighting with sitefinity pretty long (yeah.... ASP.NET noob) so it's about time to chat with community :)
I want to export my RadGrid table to PDF - ok. Done. I had to adjust each column's width because every time I exported - they were different than originally.
But now I have only few columns and I don't want to resize them for full width. Instead I'd like to center my whole table - currently it's on the left part of page.
I tried adding "<center></center>" onPdfExporting by adding them to RawHTML. Didn't work :(
Next thing I need is how to remove my filter row from pdf? It appears on every page.
I'm fighting with sitefinity pretty long (yeah.... ASP.NET noob) so it's about time to chat with community :)
I want to export my RadGrid table to PDF - ok. Done. I had to adjust each column's width because every time I exported - they were different than originally.
But now I have only few columns and I don't want to resize them for full width. Instead I'd like to center my whole table - currently it's on the left part of page.
I tried adding "<center></center>" onPdfExporting by adding them to RawHTML. Didn't work :(
Next thing I need is how to remove my filter row from pdf? It appears on every page.
4 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 13 Oct 2011, 01:12 PM
Hello Dariusz,
To center the table in pdf set the PageLeftMargin and PageRightMargin properties appropriately. By default filter row is not getting in pdf.If it is present,try the following code.
C#:
Thanks,
Princy.
To center the table in pdf set the PageLeftMargin and PageRightMargin properties appropriately. By default filter row is not getting in pdf.If it is present,try the following code.
C#:
protected
void
RadGrid1_GridExporting(
object
sender, GridExportingArgs e)
{
GridFilteringItem item = (GridFilteringItem)RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0];
item.Visible =
false
;
}
Thanks,
Princy.
0

Dariusz
Top achievements
Rank 1
answered on 13 Oct 2011, 02:21 PM
I'd like to check it but somehow I'm having a new problem with exporting:
:/
running it via Sitefinity Project Manager from my localhost, been doing it today many times and now it doesn't work. Can this error occure if one of the rows doesn't have an image in Image Column?
the error didn't show when I filtered one row. Hmmm what could that be.
Server Error in '/Blank' Application.
System.ArgumentException: Parameter is not valid.
at System.Drawing.Bitmap..ctor(Stream stream)
at Telerik.Web.Apoc.Image.ApocImage..ctor(String href, Byte[] imageData)
at Telerik.Web.Apoc.Image.ApocImageFactory.Make(String href)
at Telerik.Web.Apoc.Fo.Flow.ExternalGraphic.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.TableCell.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.TableRow.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence)
at Telerik.Web.Apoc.Fo.FOTreeBuilder.EndElement()
at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.SystemException: System.ArgumentException: Parameter is not valid.
at System.Drawing.Bitmap..ctor(Stream stream)
at Telerik.Web.Apoc.Image.ApocImage..ctor(String href, Byte[] imageData)
at Telerik.Web.Apoc.Image.ApocImageFactory.Make(String href)
at Telerik.Web.Apoc.Fo.Flow.ExternalGraphic.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.TableCell.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.TableRow.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence)
at Telerik.Web.Apoc.Fo.FOTreeBuilder.EndElement()
at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)
:/
running it via Sitefinity Project Manager from my localhost, been doing it today many times and now it doesn't work. Can this error occure if one of the rows doesn't have an image in Image Column?
the error didn't show when I filtered one row. Hmmm what could that be.
0

Dariusz
Top achievements
Rank 1
answered on 14 Oct 2011, 07:12 AM
The trick with removing filter row didn't work :/
Here you can check how my table looks like:
http://imageshack.us/photo/my-images/846/tableku.png/
And here you can check how it looks on my generated pdf:
http://imageshack.us/photo/my-images/684/generatedpdf.png/
need more ideas...
Here you can check how my table looks like:
http://imageshack.us/photo/my-images/846/tableku.png/
And here you can check how it looks on my generated pdf:
http://imageshack.us/photo/my-images/684/generatedpdf.png/
need more ideas...
0
Hello Dariusz,
Please use the OnPdfExporting event for customizing the output, because by the time the OnGridExporting event is raised, the Pdf output is already generated and ready for adding to the response.
You can examine the PDF export help topic for additional information.
I hope this helps.
Best wishes,
Mira
the Telerik team
Please use the OnPdfExporting event for customizing the output, because by the time the OnGridExporting event is raised, the Pdf output is already generated and ready for adding to the response.
You can examine the PDF export help topic for additional information.
I hope this helps.
Best wishes,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now