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

[Solved] ExportPDF doesn't seem to do anything

5 Answers 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
joni
Top achievements
Rank 1
joni asked on 02 May 2008, 02:21 PM
Hi,
I'm evaluating the latest download (bin35).
I have a UserControl that has a grid on it. The UserControl is placed in a RadPageView.  I'm trying to get the ExportToPDF to work but nothing happens. I have coded this in my UserControl:

protected void btnPDF_Click(object sender, EventArgs e)

{

RadGrid1.ExportSettings.ExportOnlyData =

true;

RadGrid1.ExportSettings.IgnorePaging =

true;

RadGrid1.ExportSettings.OpenInNewWindow =

true;

RadGrid1.MasterTableView.ExportToPdf();

}


The code is executed but nothing happens - no errors - nothing. Any ideas what I might be missing.

Here is my Grid Definition - I ajaxify what I need manually - becuase of the user control.

<

telerik:RadGrid ID="RadGrid1" runat="server"

AllowPaging="True" AllowSorting="True"

GridLines="None" onneeddatasource="RadGrid_NeedDataSource"

ShowGroupPanel="True" HorizontalAlign="Center"

oncolumncreated="RadGrid1_ColumnCreated"

ongroupschanging="RadGrid1_GroupsChanging"

onitemdatabound="RadGrid1_ItemDataBound" Skin="Office2007"

SkinID="Office2007" PageSize="50" >

<ExportSettings OpenInNewWindow="True">

</ExportSettings>

<mastertableview cellpadding="10" gridlines="None" ShowGroupFooter="True"

GroupsDefaultExpanded="False"><rowindicatorcolumn visible="False"><HeaderStyle Width="90px" /></rowindicatorcolumn><expandcollapsecolumn visible="False"><HeaderStyle Width="90px" /></expandcollapsecolumn><editformsettings><formtablestyle /><popupsettings scrollbars="None" /></editformsettings><ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

Font-Strikeout="False" Font-Underline="False" Width="100px" Wrap="False" />

<GroupHeaderItemStyle Font-Bold="False" Font-Italic="False"

Font-Overline="False" Font-Strikeout="False" Font-Underline="False"

Width="100px" Wrap="False" HorizontalAlign="Left" /><HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

Font-Strikeout="False" Font-Underline="False" Wrap="False" /></mastertableview><GroupHeaderItemStyle Wrap="False" /><clientsettings AllowColumnsReorder="True" allowdragtogroup="True"><Scrolling AllowScroll="True" UseStaticHeaders="True" /><Resizing ClipCellContentOnResize="False" ResizeGridOnColumnResize="True" /></clientsettings><ActiveItemStyle Wrap="False" /></telerik:RadGrid>


Any help is appreciated!

Joni

5 Answers, 1 is accepted

Sort by
0
joni
Top achievements
Rank 1
answered on 03 May 2008, 01:20 PM
Never Mind! Figured it out - on the client side I needed to use the OnRequestStart event for the RadAjaxManager and set eventArgs.EnableAjax = false

; 
 

0
vinit
Top achievements
Rank 1
answered on 20 May 2008, 08:56 AM
Hello

Can you please explain little bit more about the same. As I am also getting the same problem.

Also if you provide the actual implementation of the code, that would be better for me.

Is there any link for the same on the Telerik Site?

Regards,

Vinit
0
joni
Top achievements
Rank 1
answered on 20 May 2008, 01:21 PM
Hi,
On my main page that has the user control on it I have a RadAjaxManager - here is the definition for that:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"

onajaxsettingcreating="RadAjaxManager1_AjaxSettingCreating"

ClientEvents-OnRequestStart="onRequestStart" >


In that same aspx page I have the following function:

function

onRequestStart(sender, arguments)

{

var id = arguments.EventTarget;

if(id == "UCStandardVolume1$btnExport")

{

arguments.EnableAjax =

false;

}

}

The UCStandardVolume1 is the usercontrol and the btnExport is the button that is clicked to execute the export. On the server side in the usercontrol btnExport click event I have:

protected

void btnExport_Click(object sender, EventArgs e)

{


RadGrid1.ExportSettings.ExportOnlyData =

true;

RadGrid1.ExportSettings.IgnorePaging =

true;

RadGrid1.ExportSettings.OpenInNewWindow =

true;


RadGrid1.MasterTableView.ExportToPdf();


}

I Hope this is helpful!

joni
0
vinit
Top achievements
Rank 1
answered on 27 May 2008, 10:06 AM
Hello joni 

Thanks for your reply.

As the export to pdf works if it is opened in the adobe acrobat reader directly.

My requirement is that, I want to open it in the new browser.

That is in the new instance of the browser I want to open the PDF file.

If I tried the same, the blank page was opened.

Can you please try out the same at your end and please let me know what you found.

Thanks in advance.

Vinit
0
Princy
Top achievements
Rank 2
answered on 27 May 2008, 10:32 AM
Hi,

Here is a help document link which explains about Exporting from ajaxified Grid.
Export from ajaxified grid

Princy.
Tags
Grid
Asked by
joni
Top achievements
Rank 1
Answers by
joni
Top achievements
Rank 1
vinit
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or