CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Crystal Reports
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old March 15th, 2005, 04:50 AM
    PallaviDalvi PallaviDalvi is offline
    Member
     
    Join Date: Jun 2004
    Location: Heusenstamm, Germany
    Posts: 152
    PallaviDalvi is an unknown quantity at this point (<10)
    Passing log on info to sub reports

    I am trying to access a Crystal report from ASP. This report has a linked sub report. I am able to view the main report from the ASP page. but when i access the sub report i get the error--> Server has not been started. which means that my sub report is not getting the database log on info. i tried passin the info with the code available on net. but the first line itself fails saying Object does not suppot this method. My code is

    Code:
    	set crSections=session("oRpt").sections
    	'if i print the error message here it says object does not support this method. 
    	
    	For Each crSection In crSections
    		crReportObjects = crSection.ReportObjects
    		
    		'loop through all the report objects to find all the subreports
    		For Each crReportObject In crReportObjects
    			If crReportObject.Kind = ReportObjectKind.SubreportObject Then
    				
    				'you will need to typecast the reportobject to a subreport()
    				'object once you find it
    				
    				crSubreportObject = CType(crReportObject, SubreportObject)
    				'open the subreport object
    				crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
    				
    				'set the database and tables objects to work with the subreport()
    				crDatabase = crSubreportDocument.Database
    				crTables = crDatabase.Tables
    				'loop through all the tables in the subreport and
    				'set up the connection info and apply it to the tables
    				For Each crTable In crTables
    											crTable.SetLogOnInfo "test" , "","test","test"
    					if crTable.TestConnectivity then
    						Response.Write "Connecting to sub"     ' I am getting this message
    												
    					end if 
    					
    				Next
    				
    			End If
    		Next
    	Next
    please point out what i am doin wrong. Greatly appreciate the help!
    __________________
    Complex problems have simple, easy to understand wrong answers.
    Reply With Quote
      #2    
    Old March 15th, 2005, 05:48 AM
    PallaviDalvi PallaviDalvi is offline
    Member
     
    Join Date: Jun 2004
    Location: Heusenstamm, Germany
    Posts: 152
    PallaviDalvi is an unknown quantity at this point (<10)
    Re: Passing log on info to sub reports

    The culprit is
    crSubreportObject = CType(crReportObject, SubreportObject)
    i commented this line and it works!
    __________________
    Complex problems have simple, easy to understand wrong answers.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual Basic Programming > Crystal Reports


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 10:13 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009