Welcome Guest Search | Active Topics | Sign In | Register

Progress Bar - Not updating progress but is doing the task Options
Chris Felstead
Posted: Thursday, January 22, 2009 2:36:29 AM
Rank: Member
Groups: Member

Joined: 1/21/2009
Posts: 22
Hi EO,

I am working on the Progress Bar. Although the task is running, the progress bar and divStatus are not updating. Please see my code below. It's a brand new project with no master template. Just 1 page with the EO Uploader (working fine) and this page.

Code: Visual Basic.NET
Public Partial Class _default1
    Inherits System.Web.UI.Page

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

    End Sub

    Protected Sub ProgressBar1_RunTask(ByVal sender As Object, ByVal e As EO.Web.ProgressTaskEventArgs) Handles ProgressBar1.RunTask

        e.UpdateProgress(0, "Running...")

        Dim i As Integer
        For i = 0 To 99

            If e.IsStopped Then
                Exit For
            End If

            System.Threading.Thread.Sleep(500)

            e.UpdateProgress(i)
        Next i

        e.UpdateProgress(100, "The task is done!")

    End Sub
End Class


Code: HTML/ASPX
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="default.aspx.vb" Inherits="Website._default1" %>

<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>

<!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">
    <div>
    
    <script type="text/javascript">
function OnProgress(progressBar)
{
	var extraData = progressBar.getExtraData();
	if (extraData)
	{
		//The following code demonstrates how to update
		//client side DHTML element based on the value
		//RunTask passed to us with e.UpdateProgress
		var div = document.getElementById("divStatus");
		div.innerHTML = extraData;
		
	}
}
</script>
    
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Rebuild Database" />
        <br />
        <eo:ProgressBar ID="ProgressBar1" runat="server" BackgroundImage="00060301" 
            BackgroundImageLeft="00060302" BackgroundImageRight="00060303" 
            ControlSkinID="None" IndicatorImage="00060304" ShowPercentage="True" 
            Width="750px" StartTaskButton="Button1">
        </eo:ProgressBar>
        <br />
        <div id="divStatus"></div>
    
    </div>
    </form>
</body>
</html>


Thanks.
Chris.


eo_support
Posted: Thursday, January 22, 2009 5:45:13 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

The reason that divStatus is not updated is because you did not set the progressbar's ClientSideOnValueChanged. You need to set that property to "OnProgress" so that OnProgress will be called when the progress bar moves.

I am not sure why the progress bar itself is not updating. Can you run our sample project on the same machine and see if it works? Please let us know if the problem continues, in that case we will be happy to take a look on your machine via remote desktop sharing (if you are OK with this) to see what we can find.

Thanks!
Chris Felstead
Posted: Thursday, January 22, 2009 5:53:43 AM
Rank: Member
Groups: Member

Joined: 1/21/2009
Posts: 22
Thanks! Here is an update.

I've added the "OnProgress" value to "ClientSideOnValueChanged".

I can now see "The task is done!" when the task completes (with a full progress bar). However, at no point do I see the progress bar granularly fill and at no point do I see the text "Running ..."

Your project works fine. The only difference I can see is that my website is ASP.Net 3.5 and yours is ASP.Net 2.0.

Regards,
Chris.
eo_support
Posted: Thursday, January 22, 2009 6:11:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

We verified your code on ASP.NET 3.5 with Visual Studio 2008 and it works fine. Would you be interested in us taking a look on your machine?

Thanks!
Chris Felstead
Posted: Thursday, January 22, 2009 7:13:46 AM
Rank: Member
Groups: Member

Joined: 1/21/2009
Posts: 22
Thanks for that.

I can't give you access to the webserver in question as it's behind 3 high level firewalls and a VPN connection. Is it possible for you to use my code and send me a page that works. This would 100% confirm it's something to do with the project.

Is there anything in the web.config (other than the one httphandler) that needs to be added?

Could it be that I have the AJAX Control Toolkit in the site as well? Although no controls on the page.

Regards,
Chris.
eo_support
Posted: Thursday, January 22, 2009 7:32:04 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

We simply use Visual Studio 2008 to create a new file system based project, add a new page and then copy your code over and it runs fine. It moves the progress bar but does not update divStatus (as expected because ClientSideOnValueChanged is not set in your code). We did not even add anything into web.config.

The most likely reason I can think of would be caching settings on your server. Obviously if the server decides to cache whatever information we send down while the progress bar moves, you won't see anything because the information is being held on your server. To avoid that, you would try to explicitly turn off caching on all levels. To turn off ASP.NET caching, you can add:

<%@ OutputCache Location="None" %>

As a test, you can try the progress bar on your local development machine first, once you get that working, you can move it to your web server. If by any mean you can make the test page public so that it is accessiable from outside, we will be happy to take a look of that as well. That won't be as effective as accessing your server directly because that does not guarantee we see the same thing you see. However sometimes that can help as well.

Thanks!
Chris Felstead
Posted: Thursday, January 22, 2009 11:46:48 PM
Rank: Member
Groups: Member

Joined: 1/21/2009
Posts: 22
I've added Output Cache Location to be None.

I had ruled out caching as I was running the site through the Visual Studio Development Server.

The page is live at ... http://sandbox-a.itass.co.uk/DESIGN%20AND%20DEVELOPMENT\Database%20Rebuild/

Code: HTML/ASPX
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="default.aspx.vb" Inherits="Website._default1" %>
<%@ OutputCache Location="None" %>
<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>

<!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">
    <div>
    
    <script type="text/javascript">
function OnProgress(progressBar)
{
	var extraData = progressBar.getExtraData();
	if (extraData)
	{
		//The following code demonstrates how to update
		//client side DHTML element based on the value
		//RunTask passed to us with e.UpdateProgress
		var div = document.getElementById("divStatus");
		div.innerHTML = extraData;
		
	}
}
</script>
    
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Rebuild Database" />
        <br />
        <eo:ProgressBar ID="ProgressBar1" runat="server" BackgroundImage="00060301" 
            BackgroundImageLeft="00060302" BackgroundImageRight="00060303" 
            ControlSkinID="None" IndicatorImage="00060304" ShowPercentage="True" 
            Width="750px" StartTaskButton="Button1" 
            ClientSideOnValueChanged="OnProgress">
        </eo:ProgressBar>
        <br />
        <div id="divStatus"></div>
    
    </div>
    </form>
</body>
</html>


Code: Visual Basic.NET
Public Partial Class _default1
    Inherits System.Web.UI.Page

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

    End Sub

    Protected Sub ProgressBar1_RunTask(ByVal sender As Object, ByVal e As EO.Web.ProgressTaskEventArgs) Handles ProgressBar1.RunTask

        e.UpdateProgress(0, "Running...")

        Dim i As Integer
        For i = 0 To 99

            If e.IsStopped Then
                Exit For
            End If

            System.Threading.Thread.Sleep(100)

            e.UpdateProgress(i)

        Next i

        e.UpdateProgress(100, "The task is done!")

    End Sub
End Class


Your example works fine where it is but not if I copy and paste it into another project.

Thanks,
Chris
eo_support
Posted: Friday, January 23, 2009 3:57:07 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217


Can you check the page? I am getting a runtime error:

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element.

Thanks!
Chris Felstead
Posted: Friday, January 23, 2009 4:26:05 AM
Rank: Member
Groups: Member

Joined: 1/21/2009
Posts: 22
One of the slashes is the wrong way around. Should be / before database%20rebuild.

Sending the project.
eo_support
Posted: Friday, January 23, 2009 4:38:09 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
It's the same. You probably want to check the link from outside and verify.

Please make sure the project runs independently as we will need to run the project to reproduce the problem.
Chris Felstead
Posted: Friday, January 23, 2009 4:41:55 AM
Rank: Member
Groups: Member

Joined: 1/21/2009
Posts: 22
The project has been emailed. The project contains the development version that I am currently working on (not the outdated one on the link).
eo_support
Posted: Friday, January 23, 2009 5:33:04 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

We have not received your project yet. Are you sure you sent it correctly?

Thanks
Chris Felstead
Posted: Friday, January 23, 2009 5:50:41 AM
Rank: Member
Groups: Member

Joined: 1/21/2009
Posts: 22
I have resent. I have renamed the file extension to .doc incase the .zip file got caught in our filtering.
eo_support
Posted: Friday, January 23, 2009 6:04:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Nothing comes in. Please place your file on your server so that we can download directly. You can send the download location to us through private message.
Chris Felstead
Posted: Friday, January 23, 2009 6:08:47 AM
Rank: Member
Groups: Member

Joined: 1/21/2009
Posts: 22
PM'd you.
eo_support
Posted: Friday, January 23, 2009 6:23:58 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
We downloaded your project and it worked fine here.

I am not sure else we can do except for checking the issue directly on your machine. We use a service provided by:

www.gotomeeting.com

To do remote sessions. One of the benefit of this service is that you do not need to change any of your network settings. As soon as you can access any website, you can share your desktop with us. It doesn't matter if you have firewalls or VPN. And you will be watching while we work on your machine.

Thanks
Chris Felstead
Posted: Friday, January 23, 2009 6:29:49 AM
Rank: Member
Groups: Member

Joined: 1/21/2009
Posts: 22
You won't be able to get to the webserver direct, however, we might be able to do a double hop. Can you please send me the information and we'll give it a go.
WimSWimF
Posted: Wednesday, February 9, 2011 10:46:41 AM
Rank: Newbie
Groups: Member

Joined: 2/9/2011
Posts: 1
Hello,

i have the same problem now. The progress bar do the task, but doesn't update the progress und the state - infos.

On my developing - pc work all fine, but not on the corporate server (Windows Server 2008, IIS 7)

Here our codes:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Visualisation.aspx.cs" Inherits="Verkaufsempfehlungen.Visualisation" %>

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<%@ OutputCache Location="None" %>

<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>
<script type="text/javascript" language="javascript">
function OnProgress(progressBar) {
var extraData = progressBar.getExtraData();
if (extraData) {
//The following code demonstrates how to update
//client side DHTML element based on the value
//RunTask passed to us with e.UpdateProgress
var ClientID = document.getElementById('HiddenField_Progress_Message_ClientID');
var div = document.getElementById(ClientID.value);
div.innerHTML = extraData;


}

}

</script>
<eo:ProgressBar ID="ProgressBar1" runat="server" BackgroundImage="00060301"
BackgroundImageLeft="00060302" BackgroundImageRight="00060303"
ClientSideOnTaskDone="Download" ClientSideOnValueChanged="OnProgress"
ControlSkinID="None" Height="16px" IndicatorImage="00060304"
OnRunTask="ProgressBar1_RunTask" ShowPercentage="True"
StartTaskButton="Button_LC_Export" StopTaskButton="Button_Cancel_Export"
style="margin-left: 0px" Width="433px">
</eo:ProgressBar>


And here the server code:


protected void ProgressBar1_RunTask(object sender, EO.Web.ProgressTaskEventArgs e)
{
SqlCommand StoredProcedureCommand1; SqlParameter myParm1; string ConnectionString = this.SqlDataSource_Selection.ConnectionString;
SqlConnection conn = new SqlConnection(ConnectionString); conn.Open();
ReportViewer reportViewer = new ReportViewer();
SqlDataReader dr;
//reportViewer.ServerReport serverReport = new ServerReport();
StoredProcedureCommand1 = new SqlCommand("spLC_Export_Selection", conn);
StoredProcedureCommand1.CommandType = CommandType.StoredProcedure;
myParm1 = StoredProcedureCommand1.Parameters.Add("@UserID", SqlDbType.NVarChar, 100);
myParm1.Value = this.Label_Session_ID.Text;
StoredProcedureCommand1.CommandTimeout = 0;
dr = StoredProcedureCommand1.ExecuteReader();
string strSessionID_Formatted = this.Label_Session_ID.Text.ToString().Replace("\\", "_").Replace("/", "_").Replace(":", "_").Replace(".", "_").Replace("%", "_");
string strDir = "~/Uploads/" + strSessionID_Formatted + "/";
//this.Label_Session_ID.Text = strDir;
//return;
if (Directory.Exists(Server.MapPath(strDir)) == true)
{
Directory.Delete(Server.MapPath(strDir), true);
}
Directory.CreateDirectory(Server.MapPath(strDir));
if (Directory.Exists(Server.MapPath(strDir)) == false)
{
Directory.CreateDirectory(Server.MapPath(strDir));
}
double intProgress_Total = 90;
double intProgress = 1;
int intCurrentProgress = 1;
double dblCurProg = 0;
e.UpdateProgress(0,"");
while (dr.Read())
{
if (e.IsStopped)
break;
intProgress=intProgress +1;
intCurrentProgress = Convert.ToInt32 ((intProgress / intProgress_Total) * 100);
//intCurrentProgress = Math.Round(dblCurProg, 0);
e.UpdateProgress(intCurrentProgress, "Exportiere Lastkollektiv " + dr["LoadCollective_ID"].ToString() + "...");
string outputPath = Server.MapPath(strDir) + dr["LoadCollective_ID"].ToString() + ".xls";
if (dr["Dimensions"].ToString() == "3")
reportViewer.ServerReport.ReportPath = @"/rptLC_Export_3D";
if (dr["Dimensions"].ToString() == "2")
reportViewer.ServerReport.ReportPath = @"/rptLC_Export_2D";
if (dr["Dimensions"].ToString() == "1")
reportViewer.ServerReport.ReportPath = @"/rptLC_Export_1D";
//reportViewer.ServerReport.ReportServerUrl = new Uri(@"http://aklim-pc:8080/ReportServer");
reportViewer.ServerReport.ReportServerUrl = new Uri(@"https://t019a00008.destr.corpintra.net/ReportServer_LASTCOLLECTIVES");
reportViewer.ProcessingMode = ProcessingMode.Local;
ReportParameter[] reportParameters = new ReportParameter[2];

reportParameters[0] = new ReportParameter("ReportParameter_LoadCollective_ID", dr["LoadCollective_ID"].ToString(), true);
reportParameters[1] = new ReportParameter("ReportParameter_UserID", this.Label_Session_ID.Text, true);
//reportViewer.ServerReport.ReportServerCredentials.NetworkCredentials = new System.Net.NetworkCredential(username, password, domain)

//List parameters = new List();
//parameters.Add(new ReportParameter("parameterName", "value"));
reportViewer.ServerReport.SetParameters(reportParameters);
string mimeType;
string encoding;
string extension;
string[] streams;
Warning[] warnings;
byte[] xlsBytes = reportViewer.ServerReport.Render("Excel", string.Empty, out mimeType, out encoding, out extension, out streams, out warnings);
if (File.Exists(outputPath) == true)
File.Delete(outputPath);
FileStream fs = new FileStream(outputPath, FileMode.Create);
fs.Write(xlsBytes, 0, xlsBytes.Length);
fs.Close();
}
dr.Close();
if (e.IsStopped)
{
e.UpdateProgress(0, "Export abgebrochen.");
return;
}
using (ZipFile zip = new ZipFile())
{
zip.AddDirectory(Server.MapPath(strDir));
if (File.Exists(Server.MapPath("~/Uploads/" + strSessionID_Formatted + ".zip")) == true)
File.Delete(Server.MapPath("~/Uploads/" + strSessionID_Formatted + ".zip"));
zip.Save(Server.MapPath("~/Uploads/" + strSessionID_Formatted + ".zip"));
}

//Response.ClearContent();
//Response.AddHeader("Accept-Header","100");
//Response.ContentType = "Zip-File/zip";
//Response.AppendHeader("Content-Disposition", "attachment; filename=LoadCollectives_Export.zip");
//Response.TransmitFile("~/Uploads/" + strSessionID_Formatted + ".zip");
//Response.End();
e.UpdateProgress(0, " ");
}

I find your control pretty, it would be fantastic, if the progress bar would work on the corporate server too.

Thanks in advance
eo_support
Posted: Wednesday, February 9, 2011 11:13:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
To WimSWimF,

Please let us know whether you have a license for any of our product. We provide technical support for free controls to licensed users only.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.