Results 1 to 6 of 6

Thread: View crystal report in pop-up page

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    478

    View crystal report in pop-up page

    I used code below to open crystalreportviewer.
    I works fine at the same brower but not working in pop-up page.
    At pop-up page it prompts for SQL server login name and password.
    How solve this problem?

    Dim rpt As New ReportDocument

    rpt.Load(Server.MapPath(ReportName))
    rpt.SetDatabaseLogon("sa", "password")
    rpt.SetDataSource(myDataset.Tables(0))

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: View crystal report in pop-up page

    Hello,

    Can you show the code that you are using to bring up the pop-up?

    Gary

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    478

    Re: View crystal report in pop-up page

    In default.aspx page, there is a button called "Lab", on button click I added code below to open Reportview.aspx:

    Me.ClientScript.RegisterStartupScript(Me.GetType(), "OpenReport", "<script language=javascript>window.open('Reportview.aspx?FLAG=Lab','Report');</script>")

    At page_init sub, I added code at previous post to pass SQL server account and password.
    If I do not use pop-up to open Reportview.aspx, it works fine but using pop-up will prompt for SQL account and password.

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: View crystal report in pop-up page

    So, to be clear, in the page_init event of the ReportView.aspx, you have the code to set the password, or this is in the Default.aspx page_init event?

    Gary

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    478

    Re: View crystal report in pop-up page

    At page_load of reportview.aspx I have code to set password.

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: View crystal report in pop-up page

    Hello,

    So during the debug cycle, do you see the line of code to set the password being hit, before you get prompted for the username and password? If not, you might need to move that code earlier in the page life cycle.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width