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

Passing parameters that affect query

13 Answers 286 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sircutbreaker
Top achievements
Rank 1
sircutbreaker asked on 08 Jul 2008, 03:48 PM
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

13 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 08 Jul 2008, 04:12 PM
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
0
sircutbreaker
Top achievements
Rank 1
answered on 08 Jul 2008, 07:29 PM
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
0
sircutbreaker
Top achievements
Rank 1
answered on 10 Jul 2008, 01:11 PM
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
0
Steve
Telerik team
answered on 11 Jul 2008, 01:20 PM
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
0
sircutbreaker
Top achievements
Rank 1
answered on 12 Jul 2008, 10:42 AM
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
0
Steve
Telerik team
answered on 14 Jul 2008, 09:48 AM
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
0
sircutbreaker
Top achievements
Rank 1
answered on 14 Jul 2008, 11:23 PM
That video was money...

EXACTLY what I was looking for..

thanks!

Jeff
0
sircutbreaker
Top achievements
Rank 1
answered on 15 Jul 2008, 03:53 PM
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
0
sircutbreaker
Top achievements
Rank 1
answered on 15 Jul 2008, 07:23 PM
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
0
Steve
Telerik team
answered on 16 Jul 2008, 09:28 AM
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
0
sircutbreaker
Top achievements
Rank 1
answered on 17 Jul 2008, 01:21 PM
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
0
Steve
Telerik team
answered on 17 Jul 2008, 02:21 PM
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
0
sircutbreaker
Top achievements
Rank 1
answered on 17 Jul 2008, 03:00 PM
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
Tags
General Discussions
Asked by
sircutbreaker
Top achievements
Rank 1
Answers by
Steve
Telerik team
sircutbreaker
Top achievements
Rank 1
Share this question
or