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 12th, 2004, 04:41 AM
    Oni Oni is offline
    Junior Member
     
    Join Date: Sep 2003
    Posts: 23
    Oni is an unknown quantity at this point (<10)
    crystal reports (the coder way) ?

    Hi

    I have a .NET application that needs to obtain the details of the parameters for a crystal report.

    I have written some code, that opens a report into the crystal viewer and the gets the parameter info and displays it in a msgbox.

    However, the viewer prompts for the parameters, before i get a chance to get the information and display it.

    My question is, does anyone know of a way that i can get the parameter information from a report, without the user being prompted for the parameters ?



    Thanks in anticipation
    __________________
    Oni
    Reply With Quote
      #2    
    Old March 12th, 2004, 04:51 AM
    Andreas Masur Andreas Masur is offline
    Moderator
    Power Poster
     
    Join Date: May 2000
    Location: KY, USA
    Posts: 18,610
    Andreas Masur has a brilliant future (2000+)Andreas Masur has a brilliant future (2000+)Andreas Masur has a brilliant future (2000+)Andreas Masur has a brilliant future (2000+)Andreas Masur has a brilliant future (2000+)Andreas Masur has a brilliant future (2000+)Andreas Masur has a brilliant future (2000+)Andreas Masur has a brilliant future (2000+)Andreas Masur has a brilliant future (2000+)Andreas Masur has a brilliant future (2000+)Andreas Masur has a brilliant future (2000+)
    [Moved thread]
    __________________
    Ciao, Andreas

    "Software is like sex, it's better when it's free." - Linus Torvalds


    Article(s): Allocators (STL) Function Objects (STL)
    Reply With Quote
      #3    
    Old March 16th, 2004, 03:33 PM
    James Longstreet James Longstreet is offline
    Member
     
    Join Date: Apr 1999
    Location: VA BEACH
    Posts: 467
    James Longstreet is an unknown quantity at this point (<10)
    YOu need to populate the parameters to the report before viewing it the viewer or printing it to the printer.

    here is a sample from VB on how to populate parameters and formulas.

    Code:
    Dim crFormula As CRAXDRT.FormulaFieldDefinition
        Dim crParam As CRAXDRT.ParameterFieldDefinition
        
        crReport.DiscardSavedData
            
        For Each crParam In crReport.ParameterFields
            Select Case crParam.Name
                Case "{?SortType}"
                    crParam.AddCurrentValue m_strSortType
                    
            End Select
        Next crParam
        
        
        For Each crFormula In crReport.FormulaFields
            Select Case crFormula.Name
            Case "{@StartDate}"
                crFormula.Text = "DATE( 2001, 01, 01)"
            Case "{@EndDate}"
                crFormula.Text = "DATE( 2002, 03, 30)"
                crFormula.Text = """All Offices"""
            Case "{@DetailOrSummaryFlag}"
                crFormula.Text = """" & m_strSummaryDetailFlag & """"
            Case "{@Seperate}"
                crFormula.Text = """FALSE"""
            Case "{@SetShowWarning}"
                crFormula.Text = """FALSE"""
            Case Else
                'do nothing
            End Select
        Next crFormula
    Reply With Quote
      #4    
    Old November 26th, 2006, 09:46 PM
    jhersy2108 jhersy2108 is offline
    Junior Member
     
    Join Date: Nov 2006
    Posts: 6
    jhersy2108 is an unknown quantity at this point (<10)
    Wink Re: crystal reports (the coder way) ?

    Quote:
    Originally Posted by Oni
    Hi

    I have a .NET application that needs to obtain the details of the parameters for a crystal report.

    I have written some code, that opens a report into the crystal viewer and the gets the parameter info and displays it in a msgbox.

    However, the viewer prompts for the parameters, before i get a chance to get the information and display it.

    My question is, does anyone know of a way that i can get the parameter information from a report, without the user being prompted for the parameters ?



    Thanks in anticipation

    Dim APP As New CRAXDRT.Application
    Dim REPORT As CRAXDRT.Report
    REPORT = APP.OpenReport("C:\SHIPMENT_SCHEDULE\REPORTS\XL.rpt")

    REPORT.EnableParameterPrompting = False
    (this is the one you should include...disabling the parameter prompting)
    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 06:02 PM.



    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