StiWebViewer inside AjaxUpdatePanel

Stimulsoft Reports.NET discussion
Post Reply
mirfansa
Posts: 4
Joined: Thu Mar 06, 2014 10:24 am

StiWebViewer inside AjaxUpdatePanel

Post by mirfansa »

Hello,

I have a project in which I am using StiWebViewer along with other controls TreeView and Multiview etc., inside AjaxUpdatePanel.
when I click on a report in the TreeView the reports is loaded but the 'Save' and 'Print' Buttons does not work any more.
Please let me know what is the work around for this problem. I need to use the viewer inside the update panel.

I am using Stimulsoft Ultimate 2013.3.1800.0.

For your reference here following is the sample code page, the report and the data files are attached.


Thank you,
Irfan



ASPX:
-------

Code: Select all

Imports System.Data
Imports Stimulsoft.Report
Imports System.Math
Imports Stimulsoft.Report.Web

Partial Class Default2
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btn2_Click(sender As Object, e As System.EventArgs) Handles btn2.Click

        Dim data As New DataSet
        data.ReadXml("D:\\demo.xml")

        Dim report As New Stimulsoft.Report.StiReport
        report.Load("D:\\Simplelist.mrt")
        report.RegData(data)
        StiWebViewer1.Report = report

    End Sub
End Class

ASPX.VB:
----------

Code: Select all

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="Stimulsoft.Report.Web, Version=2013.3.1800.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a"
    Namespace="Stimulsoft.Report.Web" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <asp:UpdatePanel ID="UpdatePanel0" runat="server">
        <ContentTemplate>
                        <asp:Button ID="btn2" Text="GetRpt" runat="server" Height="26px" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table>
                <tr>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>
                        <cc1:StiWebViewer ID="StiWebViewer1" RenderMode="AjaxWithCache" PrintDestination="PopupWindow" runat="server" />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
Attachments
DemoData.rar
data
(251.7 KiB) Downloaded 260 times
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: StiWebViewer inside AjaxUpdatePanel

Post by Vladimir »

Hello,

Please follow the solutions proposed at the link below:
http://support.stimulsoft.com/index.php ... -component

Thank you.
mirfansa
Posts: 4
Joined: Thu Mar 06, 2014 10:24 am

Re: StiWebViewer inside AjaxUpdatePanel

Post by mirfansa »

Hi,

I used the PostBackTrigger for the Viewer control inside the UpdatePanel. But, It does not work.
Still the same situation. After I load the report asynchronously by clicking on a button, the 'Save' and 'Print' menu does not appear at all.
Please see the code:
1)

Code: Select all

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="StiWebViewer1" />
        </Triggers>
        <ContentTemplate>
            <table>
                <tr>
                    <td>
                        <asp:Button ID="btn2" Text="GetRpt" runat="server" Height="26px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <cc1:StiWebViewer ID="StiWebViewer1" RenderMode="AjaxWithCache" runat="server" />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>

2) Also I tried keeping the Viewer outside the UpdatePanel, and the button inside. In this case the Viewer is not loaded with the report.
Here is the code.

Code: Select all

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table>
                <tr>
                    <td>
                        <asp:Button ID="btn2" Text="GetRpt" runat="server" Height="26px" />
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <cc1:StiWebViewer ID="StiWebViewer1" RenderMode="AjaxWithCache" runat="server" />


Please let me know how resolve this, and make 'Save' and 'Print' work in this scenario.


Thnak you,
Irfan
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: StiWebViewer inside AjaxUpdatePanel

Post by Vladimir »

Hello,

In this case, will help the following option:

Code: Select all

<cc1:StiWebViewer ID="StiWebViewer1" runat="server" RenderMode="UseCache" />
Otherwise, please upgrade to the latest version 2014.1, in which this problem should be solved, and the AjaxWithCache mode works correctly.

Thank you.
mirfansa
Posts: 4
Joined: Thu Mar 06, 2014 10:24 am

Re: StiWebViewer inside AjaxUpdatePanel

Post by mirfansa »

Hello,

Thank you very much for the help. Now its working with RenderMode="UseCache".
however I never upgrade to version 2014.1. Once I upgrade, I will try 'AjaxWithCache' mode too.


Thank you,
Irfan
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: StiWebViewer inside AjaxUpdatePanel

Post by HighAley »

Hello.

Let us know if you need any additional help.

Thank you.
Post Reply