locked
crystal report crossing sessions? RRS feed

  • Question

  • User-533039074 posted

    hi all,

    I wrote a crystal web server using asp.net security.  i have multibple reports in a few different directories, and i have a report viewer form in each secured directory.  when i load a particlular report on one machine's web browser, if i go to another machine and launch that report, the report instantly shows up with the parameters selected from the other machine.  it's like after the report launches, the next request for that report just dishes out the previously built page.

    I have not experienced this before, and makes my report site kinda useless.  Can anyone help me figure out why these reports aren't treated as separate sessions?

    *here is the markup for the frmReportViewer.aspx page:*
        <form id="form1" runat="server">       
            <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
                AutoDataBind="true" BestFitPage="False"   Width="1100" Height="680"
                    ReportSourceID="CrystalReportSource1" BorderColor="#000099"
                    BorderStyle="Inset" PrintMode="ActiveX" />
        
            <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">

                <Report FileName=""
                </Report>

            </CR:CrystalReportSource>

        </form>

    *here is the vb code for the frmReportViewer.aspx page:*
           
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

            Me.CrystalReportViewer1.HasCrystalLogo = False
           
            If Not IsPostBack Then
                ReportName = Request.QueryString("reportname") & ".rpt"
                Me.CrystalReportSource1.Report.FileName = ReportName
                DBConnectionForReports(CrystalReportSource1.ReportDocument)
            End If

        end sub

       Public Function DBConnectionForReports(ByRef rpt As ReportDocument) As Boolean

            Dim logonInfo As New TableLogOnInfo
            'Dim table As System.Web.UI.WebControls.Table
            Dim srptServer As String
            Dim srptUN As String
            Dim srptPass As String
            Dim crConnInfo As New ConnectionInfo
            Dim subRepDoc As New ReportDocument
            Dim table As Table

            For Each table In rpt.Database.Tables

                srptServer = "calp"

                srptUN = "cdiappsro"
                srptPass = System.Configuration.ConfigurationManager.AppSettings.Item("OraclePassword").ToString

                logonInfo = table.LogOnInfo
                logonInfo.ConnectionInfo.ServerName = srptServer

                logonInfo.ConnectionInfo.UserID = srptUN
                logonInfo.ConnectionInfo.Password = srptPass
                logonInfo.TableName = table.Name

                table.ApplyLogOnInfo(logonInfo)

            Next table


        End Function

    Monday, March 29, 2010 9:01 AM

All replies

  • User-60558687 posted

    I am not really very familiar with crystal report but when I saw crossing sessions, I thought caching. Are you doing any caching?


    Tuesday, March 30, 2010 10:46 AM
  • User-533039074 posted

    that is my thought as well.   persistent caching seems to be the problem.

     

    so when asp.net runs a page, it has a compiled version in the .net temp files directory.  i see a report in the temp directory with a name like salaryinfobyjob.rpt.compiled.

    this says to me that when a page is requesting that report, it sees one all ready to go, and dishes out the one that is already compiled instead of handing out a fresh one.

    so how would i turn this off?

     

    Tuesday, March 30, 2010 12:08 PM
  • User-533039074 posted

    Response.Cache.SetCacheability(HttpCacheability.NoCache)???????? 

    Tuesday, March 30, 2010 12:13 PM
  • User-60558687 posted

    That's one way to set instruct the client to no cache.

    Do you have OutputCache set in your aspx?

    For example, <%@ OutputCache NoStore="true"  Duration="1" VaryByParam="*" %> has the same effect as the line of code you posted. But do you have configured differently?





    <%@ OutputCache NoStore="true"  Duration="1" VaryByParam

    Wednesday, March 31, 2010 10:36 AM
  • User-533039074 posted

     my solution to this whole problem was to have a different page for each report.   no more issues at all.

    Wednesday, July 14, 2010 12:53 PM