Array list for a report

Posted on 2007-03-28
Medium Priority
Last Modified: 2008-02-01
hi there,
I have a sub that it needs to take a list of parameters and pass it to the a report.
my problems occurs when i have to pass the parameters and get the values out from the array is there a way you experts can help me?

here is my code:

Public Shared Sub GenerateReport(ByVal strRptName As String, ByVal ParamArray param() As String)

        Dim crReportDocument As ReportDocument
        Dim pFieldDefs As ParameterFieldDefinitions
        Dim mypFieldDef As ParameterFieldDefinition
        Dim pVal As ParameterValues = New ParameterValues
        Dim pDiscreteVal As ParameterDiscreteValue = New ParameterDiscreteValue

            crReportDocument = New ReportDocument
            crReportDocument.Load("C:\Reports\" & strRptName)
            crReportDocument.SetDatabaseLogon("park", "park")
            pFieldDefs = crReportDocument.DataDefinition.ParameterFields

            Dim objectlist As String
            For Each objectlist In param

                pDiscreteVal.Value = objectlist.Substring(0)
                mypFieldDef = pFieldDefs(objectlist)

            ' crReportDocument.ExportToDisk(ExportFormatType.RichText, strExportPath)
            'crReportDocument.PrintToPrinter(1, True, 1, 1)

        Catch ex As Exception
        End Try
    End Sub

the only thing i know is that this part is not working and it is setup wrong:
For Each objectlist In param

                pDiscreteVal.Value = objectlist.Substring(0)
                mypFieldDef = pFieldDefs(objectlist)

how can i change in order to pass my values to the report?
Question by:jsctechy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 101

Expert Comment

ID: 18809136
What does this return  objectlist.Substring(0)



Author Comment

ID: 18809388
when execute objectlist.Substring(0) gives me the first value to be past

the line before: For Each objectlist In param hold every value of my paremeters list but from here onwards it getting stuck!!!  how can i pass the value of each pair to pDiscreteVal and mypFieldDef?

i hope that helps
LVL 101

Accepted Solution

mlmcc earned 2000 total points
ID: 18809720
LVL 101

Expert Comment

ID: 18927892
Glad i could help


Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 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