Sign in to follow this  
antony beula

Fusion Charts with DrillDown and export to excel in asp.net

Recommended Posts

Hi,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

I have used fusion charts in my web application with drilldown option using javascript & Ajax within a single page.

 

When I click on graph loaded, ajax page will be called and the generated graph is placed in another div tag.

 

Similarly, I have generated 4 graphs in a page on click the graph.

 

I have used session for user identification.

 

After Session get expired, when I click on second graph loaded using ajax how can I redirect to login page.(This is my first issue.)

 

 

Also I used one linkbutton for exporting excel file.

 

After clicking this linkbutton if I click on graph for further drilldown, it shows error message since I have used resonse.End() method for downloading excel report.

 

 

Could u please tell me some solutions (or) some other logic for implementing this.

Share this post


Link to post
Share on other sites

Hi Antony Beula,

After Session get expired, when I click on second graph loaded using ajax how can I redirect to login page.(This is my first issue.)

 

Theoretically, this is what you would do:

 

Store the user information in the session. ( I assume you are already doing this )

With the ajax request, on the server, do not update the user session variable. Before processing the ajax request, check if the session is still valid. If not, redirect to login page.

 

I hope I have said something useful.

 

Srividya :)

 

 

Edited by Guest

Share this post


Link to post
Share on other sites

This code is used for excel export on button click,

GridView dg = new GridView();

dg.HorizontalAlign = HorizontalAlign.Center;

dg.AutoGenerateColumns = true;

dg.CssClass = "Tableheadertext";

dg.CellPadding = 10;

dg.HeaderStyle.BackColor = System.Drawing.Color.FromName("#7AABD9");

dg.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;

dg.HeaderStyle.CssClass = "Tableheadertext";

dg.AlternatingRowStyle.BackColor = System.Drawing.Color.FromName("#EFF3FB");

dg.RowCreated += new System.Web.UI.WebControls.GridViewRowEventHandler(GridView_Merge_Inference_Header_RowCreated);

dg.RowCreated += new System.Web.UI.WebControls.GridViewRowEventHandler(GridView_Merge_BlankHeader_RowCreated);

dg.DataSource = ds.Tables[0];

dg.DataBind();

dg.RenderControl(htw);

HttpResponse response = HttpContext.Current.Response;

response.Clear();

response.Charset = "";

response.ContentType = "application/vnd.ms-excel";

response.AddHeader("Content-Disposition", "attachment;filename="" + filename + """);

response.Write(sw.ToString());

response.End();

After clicking this button,if i click on the graph for drilldown it ask for page refresh.

if i refresh the page all the drilldown graphs disappear, since the graphs r generated using ajax page.

Share this post


Link to post
Share on other sites

Hi Antony Beula,

After clicking this linkbutton if I click on graph for further drilldown, it shows error message since I have used resonse.End() method for downloading excel report.

Please try using j- format for drill-down instead of java script: format. It might solve this issue.

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

As described in above mentioned link,if i use j-format instead of javascript in link property of <set> tag, then also i will get the same problem.

Since i have used response.End() method for export to excel, page get refreshed.So only one graph will be displayed.Drilldown graphs will not be generated since these graphs r generated using ajax on click on the graph.

Edited by Guest

Share this post


Link to post
Share on other sites
Guest Madhumita

Hello,

After Session get expired, when I click on second graph loaded using ajax how can I redirect to login page.(This is my first issue.)

Could you please store all the previous session variables and then retrieve them when you are redirecting to the login page.

Could you please provide us with the codes or if you have a live URL we can also test from there.

Awaiting your reply.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this