6 Replies Latest reply on Jan 23, 2012 10:50 AM by Simon Ma

    Parameters

    Rookie

      I am not able to associates the value taken from parameter from users to the particular place in SQL query marked with "in (?)"...

      can somebody tell what is the way to do it and also to use 2 or more parameters.....

        • 1. Re: Parameters
          philipp.orak SupportEmployee

          Hi Gaurav,

           

          Can you post your report please? You can export your report and attach to this post. I will then have a look at it.

           

          Thanks.

          Philipp

          • 2. Re: Parameters
            Rookie

            In the report attached below,i am trying to get input from user about version and when i enter the value it gives the error but when i specify the same value in the SQL query in place of "in (?)" like N'something....' i get the desired result...

            the error which comes up is that no value associated with one or more parameters.....

            • 3. Re: Parameters
              philipp.orak SupportEmployee

              Hi Gaurav,

               

              Thanks for attaching the report. I have solved the issue, here is what you need to do:

               

              After you have created a parameter, you need to right click your "Testing LANDesk SP2" within your LDMS data source and select EDIT. Click on Parameters and add a parameter. Give it a name. In the Value drop down select <expression...>. In Expression Editor expand Parameters. You should see your "Version". Insert that one and save it.

               

              I have attached the corrected report to this post. Note that I am on SP3. So you might get an error message that the versions do not match. The error will tell you what your version is. Just open the report1.ldms in notepad and correct the version number to the one you have.

               

              Let me know how you get on with this report.

               

              Also have a look at Reporting landing page. There are some demos and a short training.

               

              http://community.landesk.com/support/docs/DOC-23582

               

              Thanks.

              Philipp

              • 4. Re: Parameters
                Rookie

                Hi Philipp,

                              

                 

                Thanks for your help.... Problem is solved the way you written...

                 

                Thanks.

                Gaurav

                • 5. Re: Parameters
                  Rookie

                  Hi Philipp,

                   

                  Can you tell me if i want to define two or more parameters,how can i specify which parameter value to go in place of which "in (?)"... Is there any procedure to do that or they automatically attach according to order in which they are defined?? and one more thing in getting multiple values from user in a particular parameter,it is giving an error which is Invalid Cast Error,so how to tackle it?

                   

                   

                  Thanks.

                  Gaurav

                  • 6. Re: Parameters
                    Simon Ma Employee

                    Hello Gaurav,

                     

                    If you have more than one parameter, indeed, the report will automatically took the parameters in th order in which you have defined them.

                     

                    Concerning the "multiple values" parameter, I think the problem come from the fact that when a user select multiple values, the report engine return a table (array) and not a simple suite of values.

                    So to get around this error, you need to use some piece of code to transform the data.

                     

                    You will be able to find some example among the standard report ( several Inventory report use multiple values parameter).

                    You will find the piece of code in the "Code" tab in the report designer.

                     

                    Simon