1

Here is my full problem so if anyone has any ideas or can offer some help, please let me know. I have a Website that will generate a Report and this Report takes some time to create. There is a MyReport.ASPX file that has a form1, Image1, and a ReportViewer control. There is also a MyReport.cs file that has C# code to generated a HTMLText string that the ReportViewer control will display. When I pull the Website up in the browser, the MyReport.cs file creates the Report before MyReport.ASPX ever gets called so my Image1 (which I need to display while the Report is being created) never gets displayed until AFTER the Report is created and displayed.

What do you suggest I do here? If I did not supply enough information, please let me know what else you need to know and I will gladly post it.

Thanks,

The below is in response to Derek.

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$(".loading").load("http://servername/Geocortex/Essentials/Web/SelectionReport1.aspx");
});
</script>

<%@ Page Language="C#" AutoEventWireup="true" Codebehind="App_Code/MyReport.cs" Inherhits="Geocortex.Essentials.WebFramework.SelectionReportPage" Culture="auto" UICulture="auto" %>

1 Answer 1

1

One method would be to move the report generating code to a webservice, or PageMethod within your page. Have your aspx page display an image, then once the page is loaded, make an ajax call to your webservice (or Page Method), using js or jquery, and update the page (remove the image and display the report returned from the webservice).

<div id="loading">  
<img src="..."/> 
</div> 

Then using jquery in the document.ready event:

$(document).ready(function(){ 
$(".loading").load(url of page with reportviewer control); 
});
Sign up to request clarification or add additional context in comments.

7 Comments

Hi Derek- Bare with me as I may not be understanding you correctly. I can remove the ReportViewer from MyReport.ASPX and leave the Image1 remaining. If I create a new ASPX page and just have the ReportViewer control in it what do I need to do from there? How can I tell when the Report is ready? How do I switch between the two pages?
ok I see, the ReportViewer is in a separate control. Create a page with the ReportViewer control. Your main page will have the image. Do a jquery.load() to load the ReportViewer page into the div where the image is. The image will appear until the jquery gets the response from the Reportviewer page, at which point it will load the reportviewer content into the div.
Hi Derek- Can you show me some code on what you mean? I'm still learning this
so basically have a page with an image in it: <div id="loading"> <img src="..."/> </div> Then using jquery in the document.ready event: $(document).ready(function(){ $(".loading").load(url of page with reportviewer control); }); Here's the link to the jquery load doc: api.jquery.com/load
Hi Derek- I think this is getting very close to complete.. In my above code I placed exactly what you said to in the SelectionReport.aspx (Page that contains just the Image). Then I have another page called SelectionReport1.aspx that has just the ReportViewer control. When I run the website in my browser the SelectionReport.aspx shows the image but the SelectionReport1.aspx never seems to replace the Image much less produce a report. Could the problem be at the last line of code I placed where the Page Inherits and Codebehind are set? Both Pages have that same line of code
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.