Passing parameters that affect query

14 posts, 0 answers
  1. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 08 Jul 2008 Link to this post

    I was wondering.. if I create a class library report... and I progammatically access the data... How do i add a parameter so that i can filter the search on the report when i deploy the library to a web project that has the viewer in it..?

    I am making a report for engine parts... and I need to be able to tell it what engine to select dynamically from my web application...

    your help is appreciated..

    thanks,

    jeff
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 08 Jul 2008 Link to this post

    Hello sircutbreaker,

    Please take a look at the Report parameters help article, the report parameters training tutorial available here, and our online "Product Line Sales Catalog" report that shows the report parameters usage at hand.

    All the best,
    Steve
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft banner
  4. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 08 Jul 2008 Link to this post

    Close... but what I really want to do is pass the parameters programmatically from the application... the user will already have an engine selected in my application and then they will select the option to generate a report...

    If i can set the parameter from the application, that would be perfect. I dont want a UI from the report itself..

    Any suggestions?

    Thanks,

    jeff
  5. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 10 Jul 2008 Link to this post

    One more thing...  I would like to have another field passed to the report.. and that would be the person who is logged into my application...

    So, the report is based on the Engine number selected and who is logged in...

    I only need to pass these two parameters to the report to make it function as I want. My application is a c# ajax enabled web app... in vs2005.

    The report dll is imported into the application and i add a report viewer to display the data...

    I would like to have a menu in my app that has the option to view several reports... but I need to be able to pass the parameters first..

    I dont want to use the UI parameters.. because... for example, I wouldnt want them to type WHO is preparing the report or select that from a dropdown.. That credential is established through asp.net membership and the user is authenticated with their  password..

    Please explain how to pass those 2 parameters..

    Thanks!

    Jeff
  6. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 11 Jul 2008 Link to this post

    Hi sircutbreaker,

    We've answered your inquiry in the support ticket you have opened. Please note that our ReportViewer does not work with ASP.NET AJAX in the current version - it would be supported as of Q2 expected by the end of July.

    Sincerely yours,
    Steve
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 12 Jul 2008 Link to this post

    My question is not answered... I need to know how i can pass a parameter FROM my web app TO the query in the class library FOR display in the report viewer..

    It doesn't need to be ajax..

    I tried:
    private string variable;

    public string Variable
    {
         get{ return variable;}
         set{ variable = value;}
    }

    and then i instantiate the class and tried to set the variable that way....

    but it didnt work..

    Please help me.. as this is the last piece of the puzzle for the solution i am developing...


    thanks


    Jeff
  8. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 14 Jul 2008 Link to this post

    Hi Jeff,

    Please note that our Reporting offering is a standard .NET class with added designer for usability reasons. So you can ignore the suggestion that you're working with a 3rd party product and pass the parameter like you would normally do within a .NET class. I've just checked the links I provided below and noticed that this is not the video I intended to provide. You can check this one out that shows you how to handle your exact inquiry.

    Regards,
    Steve
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 14 Jul 2008 Link to this post

    That video was money...

    EXACTLY what I was looking for..

    thanks!

    Jeff
  10. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 15 Jul 2008 Link to this post

    I spoke a little too soon.... The video does show me how to pass the parameters for the 2007 version... and that works... I was able to adapt and set the report parameters for the 2008 version.. the only thing is this:

    2008 parameters work in conjunction with a filter.. and the data is filtered AFTER the query...

    the version you showed me in the video injected the parameter into the select statement itself... this would be what i am looking for... as i have thousands upon thousands of engines in the db and i only want to do a report for 1 engine at a time...

    Is there a way to inject the parameter directly into the select statement where field = @parameter ??

    thanks,

    jeff
  11. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 15 Jul 2008 Link to this post

    Ok, I figured it out and I am able to pass parameters, or pass a string that is injected into the select statement...

    but... now there is another issue..

    If I have sub reports... and a master report in the project...

    When I put a report viewer on the screen in my web application, it only allows me to select one class... If I try to pass the parameter to one of the sub reports, i get an err because that report isnt instantiated..

    How do I get around this?

    Jeff
  12. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 16 Jul 2008 Link to this post

    Hello Jeff,

    Do you have your subreport item databound through the NeedDataSource event? If not, can you try using it instead of the declarative binding and see if that makes any difference?
    If that does not help, it would be best to attach your reports along with your web application to your other support ticket, so we can see how things go and offer a working solution.

    Best wishes,
    Steve
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  13. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 17 Jul 2008 Link to this post

    Ok. I figured the path out and i can set the master report to accept the parameters.. and then instantiate the sub reports with those parameters...
    that seems to be working fine..

    when i preview the report... it shows properly..

    However,

    when i preview the html... I get a parameter not valid...

    what can cause this ?

    Thanks,

    Jeff
  14. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 17 Jul 2008 Link to this post

    Hi Jeff,

    Do you have some items with zero height or width? For shape and picture items the height and width should be bigger than 0.2 in as otherwise the browser ignores them.
    If the above does not help, please send us your report and we would investigate what might be causing this.

    Greetings,
    Steve
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  15. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 17 Jul 2008 Link to this post

    I had already figured it out... i had deleted all the line shapes.. and found that i needed to make the width .02 minimum...

    thanks..

    the report works great.

    Jeff
Back to Top
DevCraft banner