Hi,
I am currently working with crystal report & i am using crystal report viewer & crystal report source. Crystal report viewer & Crystal report source that i put in update panel because when we press "Next" button ( i.e crystal report viewer property ) it doesn't allow post back to page. But problem will occur when i press Export Option ( i.e crystal report viewer property ) to select file formate (PDF), will not be opened due to update panel.
I have already done Research & development on it & i found one solution & i.e. fire trigger (like below).
<asp:PostBackTrigger ControlID="CrystalReportViewer1" />
Page will be post back (that i don't want) & pop up export option (that i want), when i am going to write this trigger "<asp:PostBackTrigger ControlID="CrystalReportViewer1" />" . So if i do it like this it is not good for my project that each & every time postback.
If any one knows better option that while pressing next button page will not going to be postback every time and Export option (of crystal report viewer ) will pop up. Is there any script for it or other option.
Thank you,
Ronak
Code:
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" >
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnCreateReport" EventName="Click" />
<asp:PostBackTrigger ControlID="CrystalReportViewer1" />
</Triggers>
<ContentTemplate>
<div style="float: left;padding-left:30px;width:95%">
<fieldset class="field">
<legend style="font-family: Calibri; color :Teal ">Reports</legend>
<table width = "100%" >
<tr>
<td width = "20%">
<asp:Label ID="lblCreatePreProcessing" runat="server" Font-Names="Calibri"
Text="Create Preprocessing Report :"></asp:Label>
</td>
<td width = "80%">
<asp:RadioButtonList ID="radbtnlistCreatePreProcessing" runat="server"
RepeatDirection="Horizontal" Font-Names="Calibri">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblError" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btn1" runat="server" Text="Button" />
<asp:Button ID="btn2" runat="server" Text="Button" />
</td>
<td>
</td>
</tr>
<tr>
<td align="center" width="100%">
<asp:Button ID="btnCreateReport" runat="server" Text="Generate Report" ValidationGroup="Save"
CssClass="ButtonClass" Width="150px" Height="40px" Font-Names="Calibri"
Font-Size="Medium" />
   
<asp:Button ID="btnCloseReport" runat="server" Text="Close Report" ValidationGroup="Save"
CssClass="ButtonClass" Width="150px" Height="40px" Font-Names="Calibri"
Font-Size="Medium" />
<%--<asp:Button ID = "btnCreateReport" Text = "Create Report" runat = "server" />--%>
</td>
</tr>
<tr>
<td align ="center" width= "100%" >
</td>
</tr>
</table>
<table width ="100%" >
<tr>
<td width ="2%">
</td>
<td width = "2%">
</td>
<td width = "2%">
</td>
<td width = "2%">
</td>
<td width = "82%">
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
AutoDataBind="true" EnableViewState="True" Height="50px" Width="350px"
HasGotoPageButton="False" HasViewList="False" />
<CR:CrystalReportSource ID="CrystalReport21" runat="server">
<Report FileName="Reports\xyz.rpt">
</Report>
</CR:CrystalReportSource>
</td>
</tr>
</table>
</fieldset>
</div>
</ContentTemplate>
</asp:UpdatePanel>
I am currently working with crystal report & i am using crystal report viewer & crystal report source. Crystal report viewer & Crystal report source that i put in update panel because when we press "Next" button ( i.e crystal report viewer property ) it doesn't allow post back to page. But problem will occur when i press Export Option ( i.e crystal report viewer property ) to select file formate (PDF), will not be opened due to update panel.
I have already done Research & development on it & i found one solution & i.e. fire trigger (like below).
<asp:PostBackTrigger ControlID="CrystalReportViewer1" />
Page will be post back (that i don't want) & pop up export option (that i want), when i am going to write this trigger "<asp:PostBackTrigger ControlID="CrystalReportViewer1" />" . So if i do it like this it is not good for my project that each & every time postback.
If any one knows better option that while pressing next button page will not going to be postback every time and Export option (of crystal report viewer ) will pop up. Is there any script for it or other option.
Thank you,
Ronak
Code:
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" >
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnCreateReport" EventName="Click" />
<asp:PostBackTrigger ControlID="CrystalReportViewer1" />
</Triggers>
<ContentTemplate>
<div style="float: left;padding-left:30px;width:95%">
<fieldset class="field">
<legend style="font-family: Calibri; color :Teal ">Reports</legend>
<table width = "100%" >
<tr>
<td width = "20%">
<asp:Label ID="lblCreatePreProcessing" runat="server" Font-Names="Calibri"
Text="Create Preprocessing Report :"></asp:Label>
</td>
<td width = "80%">
<asp:RadioButtonList ID="radbtnlistCreatePreProcessing" runat="server"
RepeatDirection="Horizontal" Font-Names="Calibri">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblError" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btn1" runat="server" Text="Button" />
<asp:Button ID="btn2" runat="server" Text="Button" />
</td>
<td>
</td>
</tr>
<tr>
<td align="center" width="100%">
<asp:Button ID="btnCreateReport" runat="server" Text="Generate Report" ValidationGroup="Save"
CssClass="ButtonClass" Width="150px" Height="40px" Font-Names="Calibri"
Font-Size="Medium" />
   
<asp:Button ID="btnCloseReport" runat="server" Text="Close Report" ValidationGroup="Save"
CssClass="ButtonClass" Width="150px" Height="40px" Font-Names="Calibri"
Font-Size="Medium" />
<%--<asp:Button ID = "btnCreateReport" Text = "Create Report" runat = "server" />--%>
</td>
</tr>
<tr>
<td align ="center" width= "100%" >
</td>
</tr>
</table>
<table width ="100%" >
<tr>
<td width ="2%">
</td>
<td width = "2%">
</td>
<td width = "2%">
</td>
<td width = "2%">
</td>
<td width = "82%">
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
AutoDataBind="true" EnableViewState="True" Height="50px" Width="350px"
HasGotoPageButton="False" HasViewList="False" />
<CR:CrystalReportSource ID="CrystalReport21" runat="server">
<Report FileName="Reports\xyz.rpt">
</Report>
</CR:CrystalReportSource>
</td>
</tr>
</table>
</fieldset>
</div>
</ContentTemplate>
</asp:UpdatePanel>