"Failed to open the connection" problem related to multiple tables in the report?

Post Author: Gadow
CA Forum: Data Connectivity and SQL
System specifics:
Web environment using ASP.Net 2.0 (from Visual Studio 2005 Professional)
Crystal Reports 2008, v. 12.0.0.549, Full
We have set up the following method for displaying reports via our website:
User is sent to a report-specific page. The user is given some filtering options specific to the report that will be viewed. When the user has specified the data filters, the user clicks a button.
The page wraps up the report parameters -- selection query, formula values, report location, the name to be displayed, etc. -- into a class which gets put into the Session object.
The page redirects to DisplayReport.aspx. ALL reports redirect to this page.
DisplayReport.aspx retrieves the report parameters from Session. A ReportDocument object is created and loaded, then set with the data from the parameters class.
A ConnectionInfo object is created and set with the relevant log on credentials. All of the reports draw from the same database, so the connection information is hard-coded as the same for all reports. The page then iterates through all of the tables in the Database.Tables collection of the ReportDocument and calls ApplyLogOnInfo to each table using the ConnectionInfo object.
The page is rendered and the user gets the filtered report.
We currently have seven reports. Five reports work fine and display the correctly filtered data with no error messages. Two reports generate a Failed to open the connection error and do not display. I have verified that the queries being sent to DisplayReport.aspx are valid, and as I said the connection information itself is hard-coded in the one page that displays the reports and this is identical to all reports.
The five reports that do work all have a single data table, either an actual database table or a single view. The two reports that do not work all have multiple tables. As far as I can tell, this is the only difference between the sets; all seven reports are based on the same DSN and I have verified the database on all of the reports. All of the reports were written using Crystal Reports 8, and all of the reports display fine in a Windows app I wrote some years ago using Crystal Reports 8. Again, the only difference between those reports that do work and those that do not is the number of tables used in the report: one table or view in the reports that display, more than one table (tables only, none use views) in the reports that do not display.
As for the code I am using, below are the relevant methods. The function MakeConnectionInfo simply parses out the components of a standard SQL connection string into a ConnectionInfo object. DisplayedReport is the ID of the CrystalReportViewer on the page.Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim o As Object = Session("ReportParams")
        Dim ReportURL As String = ""
        'Verify that there is a ReportParameters object
        If o Is Nothing OrElse o.GetType IsNot GetType(ReportParameters) Then 'Redirect to the error page
            Response.Redirect("/errors/MissingReport.aspx")
        End If
        ReportParams = CType(o, ReportParameters)
        'Verify that the report exists
        ReportURL = "/Reports/ReportFiles/" + ReportParams.ReportName
        ReportPath = Server.MapPath(ReportURL)
        If Not File.Exists(ReportPath) Then
            Response.Redirect("/errors/MissingReport.aspx?Report=" + ReportParams.ReportTitle)
        End If
        InitializeReport()       
    End Sub
    Protected Sub InitializeReport()
        Dim RD As New ReportDocument
        Dim CI As ConnectionInfo = MakeConnectionInfo(DB_Bonus)
        Dim RPF As CrystalDecisions.Shared.ParameterField = Nothing
        RD.Load(ReportPath)
        If ReportParams.SelectString <> "" Then
            Dim Adapt As New SqlDataAdapter(ReportParams.SelectString, DB_Bonus)
            Dim DS As New Data.DataSet
            Adapt.Fill(DS)
            RD.SetDataSource(DS.Tables(0))
        End If
        For Each kvp As KeyValuePair(Of String, String) In ReportParams.Formulas
            Dim FFD As FormulaFieldDefinition = Nothing
            Try
                FFD = RD.DataDefinition.FormulaFields(kvp.Key)
            Catch ex As Exception
                'Do nothing
            End Try
            If FFD IsNot Nothing Then
                Select Case FFD.ValueType
                    Case FieldValueType.DateField, FieldValueType.DateTimeField
                        If IsDate(kvp.Value) Then
                            FFD.Text = String.Format("Date()", Convert.ToDateTime(kvp.Value).ToString("yyyy, MM, dd"))
                        Else
                            FFD.Text = "Date(1960, 01, 01)"
                        End If
                    Case FieldValueType.StringField
                        FFD.Text = String.Format("""""", kvp.Value)
                    Case Else
                        'For now, treat these as if they were strings. If things blow up here,
                        'we will need to add the appropriate formatting for the field type.
                        FFD.Text = String.Format("""""", kvp.Value)
                End Select
            End If
        Next
        For Each T As CrystalDecisions.CrystalReports.Engine.Table In RD.Database.Tables
            Dim TLI As TableLogOnInfo = T.LogOnInfo
            TLI.ConnectionInfo = CI
            T.ApplyLogOnInfo(TLI)
        Next
        DisplayedReport.ReportSource = RD
    End Sub
Does this approach not work with reports containing multiple tables, or is there something I'm missing? Any meaningful suggestions would be much appreciated.

Dear Dixit,
Please refer to the Crystal report landing page to get the details
information about the support for crystal report issues.
Please use the following thread to post your questions related to
crystal report.
SAP Business One and Crystal Reports
Regards,
Rakesh Pati
SAP Business One Forum Team.

Similar Messages

  • Hi, I recently got myself an apple iphone 5s (factory unlocked) phone from the US. However on using the same in India with Vodafone, i am facing a problem where the connectivity keeps switching to EDGE most of the time. Any solutions??

    Hi,
    I recently got myself an apple iphone 5s (factory unlocked) phone from the US. However on using the same in India with Vodafone, i am facing a problem where the connectivity keeps switching to EDGE most of the time. I have a 3G plan but most of the time it switches automatically to EDGE. Thats when i have to either switch Airplane mode - On/Off and then it acts normal. Any permanant solutions to fix this problem?

    Return the iPhone personally or via friend/relative/co-worker who is in
    the US. The warranty is valid only in the country of original purchase - the USA
    in this case. Apple will not accept international shipments for evaluation nor
    will Apple ship out of the country after repair/replacement.
    How did the iPhone from the US get to you in India? Reverse that process to
    get it back to the US so someone can take it into Apple.

  • Failed to open HTTP connection to server--OBIEE11g

    Hi,
    Mistakenly my machine got restarted and after that when I tried to start OPMN services,its showing all the processes alive but after that ,while restarting BI services from windows
    its throwing an error of unexpectedly shutting down of services.
    My NQS log says:
    [nQSError: 12010] Communication error connecting to remote end point: address = 192.168.10.209; port = 80.
    [nQSError: 46119] Failed to open HTTP connection to server 192.168.10.209 at port 80.
    I have checked that IP is still same. What is the issue behind it?
    This is very urgent.I have already posted this issues many times but didn't get any response So please help.
    Regards,
    Rajeev khanna

    HI,
    I have checked Repository DB is up and while starting OPMN services from via cmd (command prompt), all components are showing up but still not able to login to EM,console and Analytics. As I have earlier mentioned that NQS server log is throwing the below error:
    [nQSError: 12010] Communication error connecting to remote end point: address = 192.168.10.209; port = 80.
    [nQSError: 46119] Failed to open HTTP connection to server 192.168.10.209 at port 80.
    Please suggest.

  • "The upload has failed. There was a problem running a virus scan for the file."  any ideas???

    "The upload has failed.
    There was a problem running a virus scan for the file. "
    This is the message i get when tryng to update
    any ideas?

    Error: "svr.VirusScanExecutionError"
    An intermittent problem with acrobat.com's underlying virus scan component causes this issue. This issue happens occasionally on a small number of server instances.
    The solution is to update the article again. Trying again typically routes you to a different host in the server array.

  • What are the problems related when if i bought the iphone 4s or 5 unactivated ????

    what are the problems related when if i bought the iphone 4s or 5 unactivated ????

    Please restate your question with more detail. As posted, there is insufficient
    information for a response. What exactly is your technical question?

  • When I try to connect the Air with my iPhone to create an Hotspot, it drops the connection and gives an error message in the iPhone saying that the device (MacBook Air) is not supported. What can i do about it?

    When I try to connect the Air with my iPhone to create an Hotspot, it drops the connection and gives an error message in the iPhone saying that the device (MacBook Air) is not supported. What can i do about it?

    The problem has been fixed with the most recent OS X software update.

  • I was listening to music on my ipod shuffle when it went off.It hasn't turned on since then.When i connect it to the computer,the connection and disconection sounds play continuously without the ipod showing.What could be wrong or how can i get it to work

    I was listening to music on my ipod shuffle when it went off.It hasn't turned on since then.When i connect it to the computer,the connection and disconection sounds play continuously without the ipod showing.What could be wrong or how can i get it to work?

    Hello,
    I am currently an owner of an Ipod Touch 4th generation. I see you are having problems with your Ipod Touch, so I will try to find a solution to your problem.
    Hold down the Sleep/Wake and Home buttons for at least 10sec. or until Apple logo appears (Nothing will be lost, this is just a "Hard Reset")
    Hope that helps!
    If none of the above solutions work, can you please respond back ASAP as I will try to find another solution to your problem (This might even help others with the same problem!)
    Cheers!
    Pizza98704

  • TS1363 my iphone 4 doesnt show up in itunes. it is also locked on the 'connect to itunes screen' when unplugged from the computer. help me!

    my iphone 4 doesnt show up in itunes. it is also locked on the 'connect to itunes screen' when unplugged from the computer. help me!

    Close your iTunes,
    Go to command Prompt -
    (Win 7/Vista) - START/ALL PROGRAMS/ACCESSORIES, right mouse click "Command Prompt", choose "Run as Administrator".
    (Win XP SP2 &amp; above) - START/ALL PROGRAMS/ACCESSORIES/Command Prompt
    In the "Command Prompt" screen, type in
    netsh winsock reset
    Hit "ENTER" key
    Restart your computer.
    If you do get a prompt after restart windows to remap LSP, just click NO.
    Now launch your iTunes and see if it is working now.
    If you are still having these type of problems after trying the winsock reset, refer to this article to identify which software in your system is inserting LSP:
    iTunes 10.5 for Windows: May see performance issues and blank iTunes Store
    http://support.apple.com/kb/TS4123?viewlocale=en_US

  • When i turn my macbook pro on , the apple logo shows up, but it is just loading. I have tried to turn if off , but the same problem appears. Someone know what the problem is?

    when i turn my macbook pro on , the apple logo shows up, but it is just loading. I have tried to turn if off , but the same problem appears. Someone know what the problem is?

    Boot into Safe Mode
    A Safe Mode boot can take a few minutes compared to a normal boot.
    Once you are in Safe Mode open System Preferences > Accounts > Login Items
    If you have anything listed there to launch when you startup your Mac, delete all items.
    Then go to the Apple menu / Restart.
    You can also use Safe Mode to do a "live verification" of the startup disk in case it needs repairing.
    Help here >  Using Disk Utility to verify or repair disks

  • HT4356 I am trying to print wirelessly from my ipad to an epson stylus SX438W. The connection appears fine on both devices but the ipad cannot connect to the printer. It has been working fine for the past 4 months. Can anyone help?

    I am trying to print wirelessly from my ipad to an epson stylus SX438W. The connection appears fine on both devices but the ipad cannot connect to the printer. It has been working fine for the past 4 months. Can anyone help?

    Have you tried restarting the printer? Reboot the iPad as well.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • I have downloaded 2 rented movies. I can find then in my downloads but can not find then in iTunes. I read the others that have had the same problem an I can't find the rented in iTunes

    I have downloaded 2 rented movies. I can find then in my downloads but can not find then in iTunes. I read the others that have had the same problem an I can't find the rented in iTunes

    Hey rangermikegsm,
    Welcome to Apple Support Communities.
    It sounds like you’re concerned because you don’t see your rentals in iTunes, but they appear to have downloaded. Take a look at the article below and check the Rentals tab in iTunes on your MacBook.
    About renting movies from the iTunes Store - Apple Support
    Find movies you rented previously
    Find your movie on the device you used to rent it.
    On a Mac or PC: Go to the Rentals tab in the Movies section of the iTunes Library.
    On an iOS device: Go to the Rental tab of the Videos app.
    Using Apple TV (2nd or 3rd generation): Look in the top shelf of the main menu.
    Ciao,
    -Jason

  • Updated my Iphone 4s to the new IOS and now i can't restart or recover it. as soon as it starts recoring, the status bar fades and the connect to itunes screen appears. WHAT THE HEY!? I'm SICK of UPDATE ISSUES!!!!!!

    Updated my Iphone 4s to the new IOS and now i can't restart or recover it. as soon as it starts recoring, the status bar fades and the connect to itunes screen appears. WHAT THE HEY!? I'm SICK of UPDATE ISSUES!!!!!!

    Yes, yes, yes... I've gone through all the common sense trouble shoots. Would't be here asking questions if that answers existed on the net. Sorry if I sound a bit edgey, but I've had nothing but issues with every update since IOS 7. Clearly there's nothing that can be done about this. and this is the final nail in the coffin to try to make me buy an Iphone 5.

  • [svn:bz-trunk] 13051: + add the connection-manager property called cookie-policy to the HTTPProxyAdapter adapter-definition designated for code coverage

    Revision: 13051
    Revision: 13051
    Author:   [email protected]
    Date:     2009-12-17 06:58:47 -0800 (Thu, 17 Dec 2009)
    Log Message:
    + add the connection-manager property called cookie-policy to the HTTPProxyAdapter adapter-definition designated for code coverage
    Checkintests: passed with 2 failures that I had prior to adding changes.  I'll dig in some more to see if I can figure out why I'm getting these failures on my Mac
    Modified Paths:
        blazeds/trunk/qa/apps/qa-regress/WEB-INF/flex/proxy-config.mods.xml

  • Multiple tables with the possibility of multiple records in each table

    Post Author: viper
    CA Forum: .NET
    Hi
    I have been trying for a few days now to come up with a CR solution to displaying data from multiple tables.  These tables, in some cases, have more then one record that needs to be displayed.  This is basically what I am trying to do.....
    I am developing a .net web application(vb) using vs2005 and an oracle 10g backend.  There is a data entry part of the site that users will enter data related to a property.  Other users will be able to search these records and have a list of records returned based on the search criteria.  The user then can click on one of these records to view a pop up CR report containing all the data related to that one property.  The PropID is passed to the pop up page and is used in the WHERE clause of my SQL statement to bring back only one property.  This data can come from as many as 18 tables if all the fields have been entered for this property.  I have tried many different solutions to get the data from multiple tables...and have had some that were close to what I need.  The best one I have will display data from multiple tables but only one record per table.....which doesn't work in my case since some of the tables have more then one record per table.
    Is there anybody that has had success in setting up similar reports?
    Does anybody know how I could use the "Group Expert" to group by the tables in my application?  I can only figure out how to group within a single table.
    It would be great if I could group by table....then just display the record(s) in each table that had the same PropID.  I am not sure if the pdf export would show all the data in that situation but it would be worth a try.  If fact...maybe I could create a new table called MyTables and just add two colums like MyTableID and MyTableName.  Then add all the table names to MyTables that I want to see in the report and add the associated MyTableID value to each table as a new column.  I could then group by MyTableID and PropID.  Just guessing here.
    Any ideas would be appreciated.

    Post Author: quafto
    CA Forum: .NET
    Your query is not too clear so I'll do my best to answer it broadly.
    You mentioned that you have a .NET web application where your users enter data on one screen and then may retrieve it on another. If the data is written in real time to a database then you can create a standard Crystal Report by adding multiple tables. The tables should be linked together using the primary and foreign keys in order to optimize the database query and give you a speedy report. Using unlinked tables is not recommended and requires the report engine to index the tables (it is quite slow).
    You also mentioned you have a "PropID" to be used in a WHERE clause. This is a great place to use a parameter in your report. This parameter can then be used in your record selection formula inside Crystal Reports. The report engine will actually create the WHERE clause for you based on the parameter value. This is helpful because it allows you to simply concentrate on your code rather than keeping track of SQL queries.
    Now, what Crystal does not do well with is uncertainty. When you design a report with X number of tables the report engine expects X number of tables to be available at processing time. You should not surprise the print engine with more or less tables because you could end up with processing errors or incorrect data. You may need to design multiple reports for specific circumstances.
    Regarding the group expert question. I'm not sure how you would/could use the group expert to group a table? A table is a collection of fields and cannot be compared to another table without a complex algorithm. The group expert is used to group and sort records based on a field in the report. Have a look at the group expert section of the help file for more information.
    Hopefully my comments have given you a few ideas.

  • Prevent the same user login on multiple computers at the same time

    prevent the same user login on multiple computers at the same time

    Is there any way (currently running 2012 Servers) that we can prevent users from logging into multiple domain computers simultaneously with the same username?
    We still want them to log into those computers, just not simultaneously?
    LimitLogin utility not work in Windows 2012 server.
    Thanks.
    Babu
    Unfortunately Windows has never offered this feature as a built-in feature, but there are several possibilities discussed in these articles:
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/0103b5e7-0db5-4fb4-bfe7-d7132983880a/limit-concurrent-logins-on-a-ws-2008-environment
    http://www.edugeek.net/forums/windows-server-2008-r2/61216-multiple-logins.html
    http://windowsitpro.com/windows/prevent-multiple-logons-gpos
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

Maybe you are looking for