VB Crystal Report >> Crystal Reports Parameter Dialog Only Displays Subset of Selectable Values

by jandras » Sat, 28 May 2005 04:48:46 GMT

I am working with a database that has a table called "Matters" with a
numeric key field called URI (unique
record ID). As shown by the following dialog box when I right-click
the field in CR's Field Explorer and
select Browse Data, there are 5,186 records in the Matters table:

http://www.teamandras.com/personal/5186.jpg

In my main report, I set Matters.URI as a parameter field using the
Parameter Expert:

http://www.teamandras.com/personal/Matter Expert.jpg

In the Web App that I built with VS .NET, I pass the URI to Crystal
Reports and everything works fine.

However, when working directly inside of CR to further develop the
report, if I press F5 (same as Report- Refresh Report Data), I
am only shown a small subset of the records, 1,038 to be exact:

http://www.teamandras.com/personal/1038.jpg

So, I cannot select the matter with URI of, say, 2000. Anybody know
why I don't see all of them?

Thanks in advance.

Joe.



VB Crystal Report >> Crystal Reports Parameter Dialog Only Displays Subset of Selectable Values

by Briscobar » Sat, 28 May 2005 05:00:28 GMT




jandras < XXXX@XXXXX.COM > rambled:

Well, firstly, I see gaps in the data, there. Just because the last one is
number 5186, does that mean that there are exactly 5186 in your table? This
will depend on your data and its application.


Are there 1,038 records there, or is it just that the last one listed is
number 1,038? By default, CR (at least version 8; i'm not sure about newer
releases) shows only the first 500 records in "Browse Field Data." You can
almost work around this by going to the report options and checking off
"Select Distinct Data for Browsing". This will return the first 500 distinct
records (which may or may not increase the number shown; again, it depends
on your data).


If this is a parameter field, you can create a text file that contains all
the possible selections. For formatting this text file, check out the help
of your version of CR.


HTH.

--

KB - MCNGP "silent thug" #26

Briscobar AT gmail DOT com

Please to be www.mcngp.com visits!





Similar Threads

1. Setting Parameters programmatically and forcing to display "Enter Parameter Values" dialog

Hi,

Is there any way to set initial parameters in the built-in VS.NET
Crystal Report Parameters dialog ?

When I set parameters in the CurrentValues collection, they are
accepted by the Crystal report control as entered parameters and the
prompting dialog doesn't appear.  How can I programmatically control
"Enter Parameter Values" dialog initial/default parameters ?

Thanks,
Mike

2. Crystal Report parameter dialog box - VB.Net

3. Suppress Parameter Dialog in Crystal Reports.net

I'm migrating my application from VB6 to VB.Net 2005 during which
Crystal reports is being upgraded to CRX!-R2 with in VS2005.
I have suppress the Parameter Prompt as the application manages the
parameters and is not transparent to users. This was done by setting
the property

oReport.EnableParameterPrompting = False   '(In VB6)

I'm trying to achieve equivalent in CR.Net I could not figure out how
to Achieve this.

Some one please help me.

thanks in advance.

4. Crystal Report parameter dialog box - VB Crystal Report

5. Crystal Report.Net discrete parameter with multiple values

I'm having a problem with Crystal report.net with ASP.NET.
The problem occurs when exporting the report. The report
uses a discrete parameter with multiple values. When the
report is loaded into the crystal report view it shows all
the values from the discrete parameter. But when I export the
report it only shows the values from the last discrete parameter value
enter.
My code is listed below:


Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()

        ' Start Loading Report
        'CR(Variables)
        Dim opTeam As String()
        Dim crParameterValues As New ParameterValues
        Dim crParameterFieldDefinitions As ParameterFieldDefinitions
        Dim crParameterFieldLocation As ParameterFieldDefinition

        Dim paramFields As New ParameterFields
        Dim paramField As New ParameterField
        Dim discreteVal As New ParameterDiscreteValue
        Dim rangeVal As New ParameterRangeValue

        CrystalReportViewer1.Visible = True
        crReportDocument.Load(Server.MapPath("CrystalReport1.rpt"))
        crReportDocument.SetDatabaseLogon("****", "****")

        Dim t As System.Web.UI.WebControls.ListBox

        If Session("ListBox2") Is Nothing Then
            t = New ListBox
            't.Item(0).Text = "All"
        Else
            t = Session("ListBox2")
        End If

        Dim ind As Integer
        Dim CRdiscretevalue As New
CrystalDecisions.Shared.ParameterDiscreteValue

        crParameterFieldDefinitions =
crReportDocument.DataDefinition.ParameterFields
        crParameterFieldLocation =
crParameterFieldDefinitions.Item("Operator Team")
        crParameterValues = crParameterFieldLocation.CurrentValues
        paramField.ParameterFieldName = "Operator Team"

        Dim paramDiscreteValue As ParameterDiscreteValue
        paramDiscreteValue = New ParameterDiscreteValue


        If t.Items.Count > 0 Then
            For ind = 0 To t.Items.Count - 1
                paramField.ParameterFieldName = "Operator Team"
                discreteVal = New ParameterDiscreteValue
                discreteVal.Value = t.Items(ind).Text
                paramField.CurrentValues.Add(discreteVal)
            Next
        Else
            paramField.ParameterFieldName = "Operator Team"
            discreteVal = New ParameterDiscreteValue
            discreteVal.Value = "All"
            paramField.CurrentValues.Add(discreteVal)
        End If

        paramFields.Add(paramField)

        crReportDocument.SetParameterValue("Operator Team",
discreteVal)


        'Bind the report to the viewer

        CrystalReportViewer1.ReportSource = crReportDocument
        CrystalReportViewer1.ParameterFieldInfo = paramFields
        CrystalReportViewer1.DataBind()
        ' End Loading Report

		'Export Code
                oStream = crReportDocument.ExportToStream( _

CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)

                With Response
                    .ClearContent()
                    .ClearHeaders()
                    .Buffer = True
                    .ContentType = "application/pdf"
                    .AddHeader("Content-Disposition", "inline;
filename=Report.pdf")
                    .BinaryWrite(oStream.ToArray())
                    .End()
                End With

6. how can i pass parameter value to crystal report viewer from vb6 - VB Crystal Report

7. Crystal reports Exception:Missing parameter field current value - need help

Hi Friends,
 I am building the dataset programmatically by calling the stored proc
by passing a parameter and i am getting the data into the dataset. As a

test when i bind this dataset to a grid i see the data in the front. So

my dataset is loaded with the data.


 My actual task is to bring up the Crystal Report using the dataset
thats being loaded with the stored proc as explained above.
Now comming to my actual problem below is exactly what i am doing in my

page_load method. I am not sure the way i am trying to add parameters
to the report but below is my code
*************************************** page load code
**************************************
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim frmDate As String = Request.QueryString("frmDate").ToString

        Dim rpt As New InspectorPayReport
        Dim ParameterField1 As New
CrystalDecisions.Shared.ParameterField
        Dim ParamterFields As New
CrystalDecisions.Shared.ParameterFields
        Dim ParamterDescreteValue1 As New
CrystalDecisions.Shared.ParameterDiscreteValue
        ParameterField1.ParameterFieldName = "Reference"
        ParamterDescreteValue1.Value = frmDate
        ParameterField1.CurrentValues.Add(ParamterDescreteValue1)
        ParamterFields.Add(ParameterField1)
        InspectPayReportViewer.ParameterFieldInfo = ParamterFields


       Dim getInspectorPayReport As Invoicing_GMAC_US_BL = New
Invoicing_GMAC_US_BL
        Dim ds As DataSet =
getInspectorPayReport.GetInvoicingReport(frmDate)
        rpt.SetDataSource(ds)
        InspectPayReportViewer.ReportSource = rpt
    End Sub


*****************************************************End of the page
load*********************


But its throwing an exception as in the subject line .


Exception Details:
CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException:

Missing parameter field current value.


Could some one please help me if you had come across with the same
situation? 
Thanks 
-L

8. Getting subreport's parameter values in Crystal Reports.NET - VB Crystal Report