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))
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
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.
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
Re: View crystal report in pop-up page
At page_load of reportview.aspx I have code to set password.
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