Crystal Reports Dynamic Sorting Fields

Posted on 2006-03-24
Last Modified: 2008-02-01
I'm trying to populate a combobox in via VB code based on the fields in a crystal report. The combobox needs to be populated differently for each report as there are several differnt ones with different fields.

Any ideas anyone?
Question by:reclusive
    1 Comment
    LVL 6

    Accepted Solution

    Try this:

            Dim strSQl As String = "SELECT TOP 0 * FROM urTable"     <-------- This selects no records but includes all the fields.  You can change this string depending on what report the user selects.

            Dim ds As DataSet = Database.ExecuteDataset(ConnectionString), CommandType.Text, strSQl)   <------- Create your dataset


            With ds
                For i As Integer = 0 To ds.Tables(0).Columns.Count - 1
            End With

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now