Please Help me !!! 
Author Message
 Please Help me !!!

I am trying to view report in ASP.NET with Crystal Report viewer.
This report has one parameter field.
This is where the problem is...if try to view a a simple report with
no parameter field it works.
But a report with parameter fields does not work.I also tried running
the crystal sample application and to my surprise that one too fails
with same exception. Please help me

CrystalDecisions.CrystalReports.Engine.InvalidArgumentException: Error
in File C:\Documents and Settings\talsanir\My
Documents\Application\EmploymentApplicationtest.rpt: Invalid table
number.

It fails at : CrystalReportViewer1.ReportSource = ("C:\\Documents and
Settings\\talsanir\\My
Documents\\Application\\EmploymentApplicationtest.rpt")

following is the code to view report and also to gather parameters:

''The viewer's reportsource must be set to a report before any
        ''parameter fields can be accessed.
        CrystalReportViewer1.ReportSource = ("C:\\Documents and
Settings\\talsanir\\My
Documents\\Application\\EmploymentApplicationtest.rpt")

        ''Get the collection of parameters from the report
        crParameterFields = CrystalReportViewer1.ParameterFieldInfo

        ''Access the specified parameter from the collection
        crParameterField = crParameterFields.Item("AuthID")

        ''Get the current values from the parameter field.  At this
point
        ''there are zero values set.
        crParameterValues = crParameterField.CurrentValues

        ''Set the current values for the parameter field
        crParameterDiscreteValue = New ParameterDiscreteValue()
        crParameterDiscreteValue.Value = 254

        ''Add the first current value for the parameter field
        crParameterValues.Add(crParameterDiscreteValue)

        ''Since this parameter allows multiple values, the discrete
value
        ''object needs to be reset.  Destroy the previous instance and
create
        ''a new instance.
        crParameterDiscreteValue = Nothing
        crParameterDiscreteValue = New ParameterDiscreteValue()
        crParameterDiscreteValue.Value = 252

        ''Add the second current value for the parameter field
        crParameterValues.Add(crParameterDiscreteValue)

        ''Set the modified parameters collection back to the viewer so
that
        ''the new parameter information can be used for the report.
        CrystalReportViewer1.ParameterFieldInfo = crParameterFields
        CrystalReportViewer1.DataBind()



Tue, 30 Aug 2005 07:41:40 GMT  
 Please Help me !!!
Don't call DataBind(). It clears out all your Viewer's settings. You should
only call DataBind() if you are setting the properties using the
DataBindings property in the IDE (which you aren't b/c you are using code).

A Crystal Reports.NET book for programmers? Its free!
* Covers ASP.NET and Windows Forms
* Teaches all phases of report development
* Alerts you to the bugs and how to get around them
* Maps out the complex ReportDocument object model
* Shows how to perform runtime customization
* Demonstrates all options of connecting with ADO.NET
* Gives complete code listings for every concept presented

www.CrystalReportsBook.com?cpgn=ngcr_031203

HTH,

Brian Bischof


Quote:
> I am trying to view report in ASP.NET with crystal report viewer.
> This report has one parameter field.
> This is where the problem is...if try to view a a simple report with
> no parameter field it works.
> But a report with parameter fields does not work.I also tried running
> the crystal sample application and to my surprise that one too fails
> with same exception. Please help me

> CrystalDecisions.CrystalReports.Engine.InvalidArgumentException: Error
> in File C:\Documents and Settings\talsanir\My
> Documents\Application\EmploymentApplicationtest.rpt: Invalid table
> number.

> It fails at : CrystalReportViewer1.ReportSource = ("C:\\Documents and
> Settings\\talsanir\\My
> Documents\\Application\\EmploymentApplicationtest.rpt")

> following is the code to view report and also to gather parameters:

> ''The viewer's reportsource must be set to a report before any
>         ''parameter fields can be accessed.
>         CrystalReportViewer1.ReportSource = ("C:\\Documents and
> Settings\\talsanir\\My
> Documents\\Application\\EmploymentApplicationtest.rpt")

>         ''Get the collection of parameters from the report
>         crParameterFields = CrystalReportViewer1.ParameterFieldInfo

>         ''Access the specified parameter from the collection
>         crParameterField = crParameterFields.Item("AuthID")

>         ''Get the current values from the parameter field.  At this
> point
>         ''there are zero values set.
>         crParameterValues = crParameterField.CurrentValues

>         ''Set the current values for the parameter field
>         crParameterDiscreteValue = New ParameterDiscreteValue()
>         crParameterDiscreteValue.Value = 254

>         ''Add the first current value for the parameter field
>         crParameterValues.Add(crParameterDiscreteValue)

>         ''Since this parameter allows multiple values, the discrete
> value
>         ''object needs to be reset.  Destroy the previous instance and
> create
>         ''a new instance.
>         crParameterDiscreteValue = Nothing
>         crParameterDiscreteValue = New ParameterDiscreteValue()
>         crParameterDiscreteValue.Value = 252

>         ''Add the second current value for the parameter field
>         crParameterValues.Add(crParameterDiscreteValue)

>         ''Set the modified parameters collection back to the viewer so
> that
>         ''the new parameter information can be used for the report.
>         CrystalReportViewer1.ParameterFieldInfo = crParameterFields
>         CrystalReportViewer1.DataBind()



Tue, 30 Aug 2005 09:29:32 GMT  
 Please Help me !!!
Thanks Brian.
But the code is not even going to the DataBind().
It is failing at crystalreportviewer1.reportsource.
The report as such looks fine no problem.

Even when i ran the samples given by crystal it fails with same error.
Please help me in this regard.



Tue, 30 Aug 2005 22:04:28 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

2. PLEASE HELP PLEASE HELP PLEASE HELP

3. Please Help...Crystal Reports..Please Help

4. PLEASE HELP... PLEASE HELP... PLEASE HELP...

5. Please Please PLEASE HELP!!!!!

6. Please please please, help me :-)

7. Please, please, please help!!

8. Cloning problem -- please please please help

9. Please, please, please, help!

10. DATAbase Printing PLEASE, PLEASE Help me - please?

11. DATAbase Printing - PLEASE, PLEASE Help me - please?

12. Please, Please, Please,Help craxdrt.dll

 

 
Powered by phpBB® Forum Software