Get Crystal Report data in session -


i have noticed crystal report runs linq query once again when page index changed, means when load second page first page? wanted know if can page loaded can keep values in session.

just hint required not getting desired results google.

update: sorry in hurry clicked on wrong tag. problem like:

this code below use fr running crystal report:

var rpt = new result();                     list<class> lst1 = new dalmethod().get(); rpt.setdatasource(lst1); crreportviewer.reportsource = rpt; 

when switch page 1 2 or more, method in dal called again taking same time took first time load, want have data in session when query runs first time, , next time when page index, show data session.

is there way around can page index in c# code?

i had found solution, hope might else: using generic list data source:

  1. as know page loads first time, mean not postback, can initialize list maintained in session.

  2. after showing report can add data source (which list type).

  3. on report page shift data taken session.

    if (!ispostback) {  //clear session , create new session  session["reportgenericlist"] = null; } list<class> datasourcelst=null;  if (session["reportgenericlist"] != null)   {     datasourcelst= (list<class>)session["reportgenericlist"];   } else   {    datasourcelst = //call methods fill datasource    session["reportgenericlist"] = datasourcelst;   } 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -