Progress Bar Not Closing

Thread is closed for posting
9 posts, 0 answers
  1. Tracy
    Tracy avatar
    118 posts
    Member since:
    Nov 2010

    Posted 23 Nov 2010 Link to this post

    Hi,

    I have added a progress bar to one of my pages to monitor when a custom process is complete.  I used the code from the demo Upload/Monitoring For Custom Progess.

    The progress bar opens and works great, but it doesn't close when the process is complete.  After reading the other threads concerning the Progress Bar not closing, I thought the problem might be that something in the procedure I am calling was preventing the Progress Bar from closing, so I commented out that line and ran it again and the Progress Bar still doesn't close.

    Did I miss something in the example or is there a way to manually close or stop the progress bar?

    Thanks

    Here is the aspx code

    <

     

    telerik:RadProgressArea

     

     

    ID="RadProgressArea1"

     

     

    runat="server"

     

     

    HeaderText = "Creating PDF Files For Invoices"

     

     

    DisplayCancelButton="True"

     

     

    ProgressIndicators="FilesCountBar,

     

    FilesCount,

    FilesCountPercent,

    SelectedFilesCount,

    CurrentFileName,

    TimeElapsed,

    TimeEstimated"

     

    Skin="Hay">

     

     

     

    <Localization Uploaded="Uploaded" />

     

     

    </telerik:RadProgressArea>

     

     

    <telerik:RadProgressManager ID="RadProgressManager1"

     

     

    Runat="server"

     

     

    SuppressMissingHttpModuleError="True"

     

     

    RefreshPeriod="100" />

     

    Here is the code on the button click

     

    Private

     

    Sub ibtPDFExport_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibtPDFExport.Click

     

     

    Dim aryInvoiceNumber() As String

     

     

     

     

     

    Dim i As Integer = 0

     

     

    Dim SqlStr As String = Nothing

     

     

     

     

     

    Dim sdrIntranetObjects As SqlDataReader

     

     

    Dim strDirectorySuffix As String = Nothing

     

     

     

     

     

    Dim strFileName As String = Nothing

     

     

     

     

     

    If Me.txtRecordsSelectedCount.Text = "0" Then

     

     

     

     

    MsgBox(

    "You must select at least 1 invoice to export.", vbOKOnly)

     

     

    Else

     

     

     

     

     

    Dim Progress As RadProgressContext = RadProgressContext.Current

     

    Progress.Speed =

    "N/A"

     

     

     

     

     

    ReDim aryInvoiceNumber(Convert.ToInt16(Me.txtRecordsSelectedCount.Text) - 1)

     

     

    For i = 0 To Convert.ToInt16(Me.txtRecordsSelectedCount.Text) - 1

     

    aryInvoiceNumber(i) = Split(

    Me.txtRecordsSelected.Text, ";")(i).ToString

     

    SqlStr =

    "SELECT InvoiceNumber, PeriodEnding, Contract, Customer From [dbo].BLL_BillingInvoiceHeader WHERE InvoiceNumber = '" & aryInvoiceNumber(i).ToString & "'"

     

     

     

     

    sdrIntranetObjects = UDF_GetDataReader(SqlStr)

     

    While sdrIntranetObjects.Read()

     

    strDirectorySuffix = sdrIntranetObjects(

    "Customer") & "\" & sdrIntranetObjects("Contract") & "\"

     

     

     

     

    strFileName =

    String.Format("{0:yyyy-MM}", sdrIntranetObjects("PeriodEnding")).ToString & "~" & sdrIntranetObjects("InvoiceNumber")

     

     

    End While

     

     

     

     

    sdrIntranetObjects.Close()

    Progress.SecondaryValue = i + 1.ToString()

    Progress.SecondaryPercent = ((i + 1) / Convert.ToInt16(

    Me.txtRecordsSelectedCount.Text)).ToString()

     

    Progress.CurrentOperationText = strDirectorySuffix +

    "\" & strFileName

     

    Progress.SecondaryTotal = Convert.ToInt16(

    Me.txtRecordsSelectedCount.Text)

     

     

    If Not Response.IsClientConnected Then

     

     

     

     

     

    'Cancel button was clicked or the browser was closed, so stop processing

     

     

     

     

     

    Exit For

     

     

     

     

     

    End If

     

     

     

     

    USB_CreatePDFReport(70001,

    "no", strDirectorySuffix, strFileName, aryInvoiceNumber(0).ToString)

     

     

    Next

     

     

     

     

     

    End If

     

     

     

     

     

    End Sub

     

  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 25 Nov 2010 Link to this post

    Hi Tracy,

    Is the area inside of an UpdatePanel/RadAjaxPanel? If so, I suggest that you undertake the following approach:

    1) Set the Context.OperationComplete = true property after you have finished monitoring the progress
    2) Add the following event for the OnClientProgressUpdating event:

    <script type="text/javascript">
           function updating(sender, args) {
               if (args.get_progressData() && args.get_progressData().OperationComplete == 'true')
                   args.set_cancel(true);
           }
       </script>


    Greetings,
    Genady Sergeev
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tracy
    Tracy avatar
    118 posts
    Member since:
    Nov 2010

    Posted 27 Nov 2010 Link to this post

    Hi Genady,

    Thank you for your response.  I added the code you suggested, but I now get javascript errors: sender is unefined and args is undefined.

    I think the problem is because I am using a master page on the form (actually 2 nested master pages).  Sorry I didn't mention this in my original post.  When I look at the source code on the page the radprogressarea is being defined as follows:
    <div id="ctl00_ctl00_cphMainContent_cphNavigationContent_RadProgressArea1"

    How do I get the javascript in your previous post to work with master pages?

    Thank you for your help.

    Tracy

     
  5. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 02 Dec 2010 Link to this post

    Hi Tracy,

    Where is the ProgressArea - on the master or on the content page?

    Regards,
    Helen
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  6. Tracy
    Tracy avatar
    118 posts
    Member since:
    Nov 2010

    Posted 02 Dec 2010 Link to this post

    The progress area is on the content page.

    Thank You
  7. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 03 Dec 2010 Link to this post

    Hello Tracy,

    There shouldn't be any problem if you place the javascript on the content page after the progress area declaration.

    Regards,
    Helen
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  8. Tracy
    Tracy avatar
    118 posts
    Member since:
    Nov 2010

    Posted 04 Dec 2010 Link to this post

    Hi Helen,

    Thanks for your response and all your help. 
    I finally got my progress bar to work correctly.  My problem was that the button I was initiating the progress bar from was within an update panel but I did not have the progress bar inside an update panel.

    Thank You
  9. Urmil
    Urmil avatar
    1 posts
    Member since:
    Aug 2012

    Posted 13 Aug 2012 Link to this post

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ReportExportControl.ascx.cs"
     Inherits="MS.Support.Seam.Console.Controls.Reports.ReportExportControl"
    %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    <div class="divReportExport">
        <telerik:RadProgressArea ID="RadProgressArea1" runat="server" Language=""  style="position:absolute;top:200px; left:350px" ProgressIndicators="CurrentFileName">
            <Localization CurrentFileName="">
            </Localization>
        </telerik:RadProgressArea>

    <telerik:RadAjaxPanel>
    <telerik:RadProgressManager ID="RadProgressManager1" runat="server"  />
     <span><asp:Button ID="butExport" Text="Export"
             OnClick="butExport_Click" runat="server" /></span>
     <span>Include Data :
        <asp:DropDownList  id="ddlIncludeData" runat="server">
         <asp:ListItem Text="Current Page" Value="Current"/>
         <asp:ListItem Text="All Pages" Selected="True" Value="All"/>
        </asp:DropDownList></span>
     <span>Export To :
        <asp:DropDownList  id="ddlExportFormat" runat="server">
         <asp:ListItem Text="Excel" Value="Excel"/>
         <%--<asp:ListItem Text="PDF" Value="PDF"/>--%>
        </asp:DropDownList></span>

    </div>
    </telerik:RadAjaxPanel>


            protected void butExport_Click(object sender, System.EventArgs e)
            {
                        RadProgressContext context = RadProgressContext.Current;
                        context.CurrentOperationText = "Creating Items...";

            }

            protected override void OnUnload(EventArgs e)
            {
                RadProgressContext context = RadProgressContext.Current;
                context.CurrentOperationText = "Writing file to client...";
                context.OperationComplete = true;
                base.OnUnload(e);
            }
    I have above code on my page. I am able to see progress bar with two messages but it never got closed. Am I missing any thing?

    Thanks,

  10. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 16 Aug 2012 Link to this post

    Hi Urmil,

    I have tested the provided code and the issue could not be reproduced. Could you please open a new support ticket and send us a runnable sample project which reproduces the problem.

    All the best,
    Peter Filipov
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017