This is a migrated thread and some comments may be shown as answers.

Invalid value of report parameter

11 Answers 1926 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Camila Foltran
Top achievements
Rank 1
Camila Foltran asked on 30 Jul 2012, 01:14 PM
Hi,
 I updated the 2008 version to 2011 version of telerik reporting and am having trouble with some reports, it gives the error: 'value of the parameter of the report invalid'
Help me pleaseeee!!

11 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 30 Jul 2012, 02:05 PM
Hello Camila,

We have made quite a few changes since 2008 releases of Telerik Reporting. One of those changes (since Q1 2010) is that report parameters are always validated. Namely, when a report enters in the processing stage, its value is validated against its validation properties. If one or more parameters do not have valid values, processing is aborted. Report Parameters define the following properties used to validate the supplied parameters' value:
Type
 Determines the type of the values that are acceptable. The allowed types are Boolean, DateTime, Integer ,Float ,String. The default parameter type is String.
AllowNull
Determines if null (Nothing in VB.Net) is acceptable.
AllowBlank
Applied only when the parameter is of type String. Determines if an empty string is acceptable.

The "Please input data for all parameters" error means you should make sure the report parameters' values and types are valid and supported. To do this set a breakpoint in the ReportParameters("<Your_Parameter>").Value assignment code and verify all parameters comply to these requirements.

For example if a null value comes for a parameter, you can decide whether you want to allow it with AllowNull property of the report parameter or handle it in some other way (e.g. in the database query with IS NULL check, with the built-in IsNull function (see Functions) if you set the report parameter value in expression or with a check whether the value is not null in your VB.NET code.

We cannot offer concrete suggestions as we do not have your report, so if you're still having problems, it would be best if you provide us with a runnable sample report that exhibits the problem and we would advise you once we review it.

All the best,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Camila Foltran
Top achievements
Rank 1
answered on 31 Jul 2012, 12:37 PM
Hi, thanks!
I put the same type float and AllowNull true and resolved. Thank you!
0
Sunil
Top achievements
Rank 1
answered on 09 Aug 2013, 02:03 AM
I have an issue with Report to pass parameter to stored procedure.

I created report using stored procedure and passing parameter, Both parameters are integer.
Report works fine on report viewer.

I use partial view to call aspx page and pass both parameter using viewbag, I got the parameter in view bag but report gives error about missing parameter.

 base.OnLoad(e);
         var instanceReportSource = new Telerik.Reporting.InstanceReportSource();         
         var report = new Reports.MyreportDetails();
         
         instanceReportSource.ReportDocument = report;
         instanceReportSource.Parameters.Add(new Telerik.Reporting.Parameter("@test1", ViewBag.test1));
         instanceReportSource.Parameters.Add(new Telerik.Reporting.Parameter("@test2", ViewBag.test2));
                          
         ReportViewer1.ReportSource = instanceReportSource;
         
         ReportViewer1.RefreshReport();


When I run the project, It gives me error that stored proc is expecting Parameter @test1 is missing.

Thanks in advance, Please provide me the solution for this issue. 



Thanks,
Sunil
0
Stef
Telerik team
answered on 13 Aug 2013, 05:34 PM
Hi Sunil,

Please take a look at the following materials:

Notice how SQL parameters are mapped to report parameters. In order to pass values to the SQL parameters you need to set only the values of the report parameters through the used report source object.

I hope this helps.


Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

0
Jimmy
Top achievements
Rank 2
answered on 03 Dec 2013, 07:00 PM
What is this guys ? http://www.telerik.com/help/reporting/telerik.reporting-telerik.reporting.ireportdocument.html

Please I need help


1 . I have MAINREPORT containing 4 subreports : SUB1,  SUB2 , SUB3, SUB4
2 . Secondly, I have put an expressions on controls as [=Parameters.XYZ] set with AllowNulls without any DataSource.I want to use dynamically.
3 . I have used this MainReport as a library in my web Application.
4 . Now I have  used this code:

            Telerik.Reporting.TypeReportSource tr = new Telerik.Reporting.TypeReportSource();
            tr.TypeName = "ClassLibrary2.MAIN, ClassLibrary2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
            this.ReportViewer1.ReportSource = tr;
            this.ReportViewer1.DocumentMapVisible = true;
            this.ReportViewer1.RefreshReport();

5. My Question is now :

1. How to set and get Report Parameters
2. How to attach file dynamically on different reports.
3. How to get Reports and Sub Reports from ReportViewer


I was trying to figure out by looking at your web url .. Which is not even working..
No Books
No blog
0
Jimmy
Top achievements
Rank 2
answered on 03 Dec 2013, 07:40 PM
Anyways : Thanks Boss

I have fixed Half of it.. Probably my code could help someone..

          var reportSource= new Telerik.Reporting.InstanceReportSource();
               reportSource.ReportDocument = new ClassLibrary2.MAIN();
            Telerik.Reporting.Report[] reports = (Telerik.Reporting.Report[])reportSource.ReportDocument.Reports; // MAIN REPORT
            Telerik.Reporting.ReportParameterCollection rs =r[0].ReportParameters;   //  GET MAIN REPORT which is 0
            if (rs[0].Name == "contractNo")  // SET PARAMETER defined in a MAIN REPORT
            {
                rs[0].Value = "wwq2213214";
            }
            this.ReportViewer1.ReportSource = instaneReportSiurce;
            this.ReportViewer1.RefreshReport();


But I am looking for displaying file contents ?
????????????????????????????????????????? MY QUESTION
0
KS
Top achievements
Rank 1
answered on 06 Dec 2013, 03:35 PM
Hi,

Not sure what the question is, but:
1. report parameters with names are contained in the report instance - ReportParameters collection
2. report parameters values can be set through the report source Parameters collection, where the name of the report parameters are known
3. how to set the SubReport report is shown here - How to: Set ReportSource for SubReport
4. how to get and modify an item from the report instance is shown here - Access items from report, calling application and Table

- KS
0
Jimmy
Top achievements
Rank 2
answered on 14 Jan 2014, 05:07 PM
Please find an attached image. I am curious to know how can i do this using Telerik.Thanks
0
Doug
Top achievements
Rank 1
answered on 16 Jan 2014, 05:02 PM
You said: We have made quite a few changes since 2008 releases of Telerik Reporting. One of those changes (since Q1 2010) is that report parameters are always validated."

Why? Now I can't send in any old object, and after all the underlying type of Parameter.Value is "Object". 

Why not allow anything to go through and let the report cast it on the other end? 

For example, let's say I've got a list of 1000 insurance policies (or whatever) ... and I DON'T want Telerik to go to the database. 

Now I'm going to have serialize the list into a string, and deserialize in the report. Why force this? Why not just be able to send an object?
I don't mind doing it - but isn't it just a waste of time and resources?

Why the lockdown at all - to string, int, bool etc. only?  

Thanks! I'm sure there's a good explanation ... I just don't know what it is. 

Thanks -
Doug 
0
KS
Top achievements
Rank 1
answered on 16 Jan 2014, 07:19 PM
Hi Jimmy,

This looks to me like a standard grouping by the data in the gray line, and the rest goes in the detail.

@Doug I believe the reason is parameters are used in expressions and not to send data to the report. In expressions the type matters.. there are conversions, comparisons and etc, etc. Without specific type it will all go wrong. Instead of the whole object, send the index how to find it in the data source, or set the data outside the report. Each report instance can be changed at run time.

Regards,
-KS
0
Jimmy
Top achievements
Rank 2
answered on 16 Jan 2014, 09:55 PM
Thanks KS. I have done this by dynamically creating new object of subreport under loop. Thanks .
Tags
General Discussions
Asked by
Camila Foltran
Top achievements
Rank 1
Answers by
Steve
Telerik team
Camila Foltran
Top achievements
Rank 1
Sunil
Top achievements
Rank 1
Stef
Telerik team
Jimmy
Top achievements
Rank 2
KS
Top achievements
Rank 1
Doug
Top achievements
Rank 1
Share this question
or