StrataFrame Forum

Pass Parameter(s) to Report Sharp Shooter

http://forum.strataframe.net/Topic25676.aspx

By Terry Bottorff - 1/31/2010

Following the code from a sample I found on this forum, I have a simple form with a button on it that I click and want it to render my report. Of course I have a BO and BBS. I fill my BO.

The report will render correctly but now I would like to pass a parameter to my report. I know I need to use GetParameter in my report but I am not sure what I need in my form or button click. TIA

By Trent L. Taylor - 1/31/2010

Terry,

Actually you are better off using the CustomBBS.  I can give you some long explanations here, but you need to build the data source and deal with the criteria and parms there.  If you download the StrataFlix sample it will show you how to do this very thing.

By Terry Bottorff - 2/1/2010

Trent, I'm sorry but I did use the Custom BBS. What I have is a simple report that will fit for many different kinds of people. I am able to use the same BO but just a different Select to get the data. What I was wanting to do is get a different value to use in the heading of the report. Such as:

Results for Bare Back or Results for Bull Riders and so forth. So what I was trying to do is say let cevt="Bare Back" and run the report and then let cevt="Bull Riders" and run the report. I am not sure how to do it your way. Any help would be appreciated. TIA. Maybe the Stratflix sample will have that in there and I will look at that this afternoon to see if I can find it.
By Trent L. Taylor - 2/1/2010

Yeah, this is the same thing that we do in our medical app as well as StrataFlix. There are a number of ways to handle this, either by pulling or setting this value in your data source or to include it in your criteria which is also exposed. If you look at the StrataFlix sample, you will be able to see how we handle it there versus me give a long-winded explanation here. Let me know if you need some help or explanation once you get the StrataFlix loaded. Wink
By Edhy Rijo - 2/1/2010

Terry Bottorff (02/01/2010)
...What I was wanting to do is get a different value to use in the heading of the report. Such as:

Results for Bare Back or Results for Bull Riders and so forth. So what I was trying to do is say let cevt="Bare Back" and run the report and then let cevt="Bull Riders" and run the report.




Hi Terry,



Where are you getting the value for "cevt"? if this is in the database, you can simply use that field for the header or depending on how you are generating the report you can pass that value to the report before it gets render.



In this case, it would be easier to use any of the sample posted in the forums to try to reproduce your issue then re-post the sample here so we can take a look at.
By Terry Bottorff - 2/1/2010

It is a variable defined in the code on the form. On the Strataflix sample where does one begin to look at the code? TIA
By Edhy Rijo - 2/1/2010

Again this would be much easier with a sample.



Here I took a sample provided by Trent a while ago and modified to use the RSS parameter way because I believe it will be easier in your case to do this way.



I build the sample with the latest assemblies from SF and RSS if you don't have those, please change the references.



In Form1.vb pay attention to the ReportManager1_GetReportParameter method. Also you must add the parameter to the Document's parameters collection, then show the parameter using the GetParameter("ParameterName") function in the report.



Have fun!Tongue
By Trent L. Taylor - 2/1/2010

Thanks for taking the time to create the sample, Edhy.  Wink
By Terry Bottorff - 2/2/2010

Oh thank you so much. Your help is over whelming......
By Terry Bottorff - 2/2/2010

Thanks Edhy, the piece I was missing was setting up the Document's parameter list. Just needed that little nudge to get me going. Thanks to all. Trent thanks for the idea to include some of the info in the data table even if it is not part of the data. That also worked..........
By Trent L. Taylor - 2/2/2010

Glad you got it going. This is a great community out here! Smile
By Edhy Rijo - 2/2/2010

Terry, glad it is clear now, also when you have a chance take a look at the RSS Sample projects, they are really good.  I have been there in the past and I am happy to contribute as much as I can.

Trent, you are welcome.