This is a migrated thread and some comments may be shown as answers.

Exporting to PDF

4 Answers 172 Views
GridView
This is a migrated thread and some comments may be shown as answers.
naresh
Top achievements
Rank 1
naresh asked on 29 Aug 2011, 03:23 PM
Hi,

I am experiencing some problem.While exporting the gridview to PDF using RadDocument.
If normal gridview with out any grouping its working fine,
In case if I am grouped the grid on some column the data is exporting in wrong way.
Suppose in case my grouping contains 5 rows after exporting to PDF in PDF file that group contains 25 rows.(incase 3 then 9).
I followed the Demos which you provided in the silverlight demo as well as installed demos.for that also same problem.
you can check in your online demos.

Wonder till no one found that problem in your demos.Here I am giving demo link 

http://demos.telerik.com/silverlight/#GridView/PrintAndExportWithRadDocument

just group and export to PDF.

please solve the problem and it si helpfull if you give solved demo project.

Thanks and Regards
Naresh Mesineni

4 Answers, 1 is accepted

Sort by
0
naresh
Top achievements
Rank 1
answered on 29 Aug 2011, 04:00 PM
Hi,

I found the solution ....In telerik demo code there is bug (may be...)

private void AddGroupRow(Table table, QueryableCollectionViewGroup group, IList<GridViewBoundColumnBase> columns, RadGridView grid)
{
----------------
--------------
      	for (int i = 0; i < group.ItemCount; i++)
               {
                      AddDataRows(table, group.Items, columns, grid);
               }
T
hat red marking code was wrong
if (group.ItemCount > 0)
{
AddDataRows(table, group.Items, columns, grid);
}
For me its working fine.... Any suggestions ???? Thanks and Regards Naresh Mesineni
0
David
Top achievements
Rank 1
answered on 28 Sep 2011, 04:49 PM
Thanks allot naresh
But Did you notice any weiredness after exporting to pdf.
The Row size is too big,,even though the data is not so big but still the cell size is too big.
Can you help me on this.

Thanks

    
0
naresh
Top achievements
Rank 1
answered on 29 Sep 2011, 08:41 AM
Hi David,

The following code may be solve your problem.I had faced similar kind of problem.

RadDocument document = new RadDocument();

set the page orientation

document.SectionDefaultPageOrientation = PageOrientation.Landscape;

while creating the cell mention the cell width 
TableCell cell = new TableCell();
cell.PreferredWidth = new TableWidthUnit((float)xxxxx);
 
Paragraph paragraph = new Paragraph();
//paragraph.LineSpacing = 1.0;
cell.Blocks.Add(paragraph);
Span span = new Span();
span.FontFamily = new FontFamily("Verdana");
span.FontSize = 12;
span.Text = value;
paragraph.Inlines.Add(span); Hope this will work...if not send me the exported document then I will understand exactly what was problem. Thanks and Regards Naresh Mesineni


0
Makrand
Top achievements
Rank 1
answered on 19 Oct 2012, 05:07 AM
can you please share your all code.....  guess the existing example is change now... and i m facing some issue in it
Tags
GridView
Asked by
naresh
Top achievements
Rank 1
Answers by
naresh
Top achievements
Rank 1
David
Top achievements
Rank 1
Makrand
Top achievements
Rank 1
Share this question
or