Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Report Parameters
josh.flaumenhaft
<p>I am having some problems with a report parameters. I am trying to filter results based on user input. The problem I am running into is that the user input does not match a column in the SQL select statement. As an example, the column in the select statement is pulling a full heirarchy (propertybuildingfloorspace), but I am only getting input for the property. I cannot add that to the where statement because there is no property column selected. When I try to bind the dataset parameter to the report parameter, I get "Cannot set the string value (parameter) to parameter1. SQL error #1:The index 1 is out of range." I'm not sure if I am explaining this very well but any help would be most appriciated.</p>
Find more posts tagged with
Comments
GLO_FR
<p>Hi</p><p> </p><p>can you upload a design with a flatfile as datasource or an example based on the Classic Model DB</p>
josh.flaumenhaft
<p>Hello GLO_FR,</p><p> </p><p>using the classic model db and the customers table, my problem would be if the address1, city, state and zip were combined into a single database column (let's call it mailing address). if you did a select mailing address from customer you would get the full mailing address in a single field. what I am trying to do is configure a report parameter that asks for the zip code, but since there is no seperate column for zip in the select statement, I cannot add a where zip = ? to my SQL query. does that make any more sense?</p>
GLO_FR
<p>Ok, I think I get it.</p><p>Can you identify and separate the value you want to filter on ?</p><p> </p><p>For instance in your first example, can you identify and get the "property" value from the all hierarchie field and put it in a separate column ?</p><p>Usign SQL, you've got order like left, right, locate... </p><p>Using BIRT, you've BIRT function or JavaScript...</p><p> </p><p>If possible, put this ID or what ever it is in a separate column and use it as filter (for SQL use a parameter in a WHERE clause, for BIRT <span style="font-size:14px;">use a filter and bind it to your report parameter).</span></p><p> </p><p><span style="font-size:14px;">BTW, using a </span><strong>like </strong><span style="font-size:14px;">in your SQL query is also </span>possible<span style="font-size:14px;">.</span></p>
josh.flaumenhaft
<p>is there a why to pass the user input parameter into the sql query for my like clause? Example, I have a report parameter called LdCntr. is it possible to pass that parameter into my sql query so I can add a where hierarchy like LdCntr?</p>
GLO_FR
<p>Of course you can.
In your query type
SELECT * FROM MY_TABLE
WHERE MY FIELD LIKE ?
Then instead of linking the query parameter directly to the report parameter, you have to build and expression like this one
'%' + params["Like parameter"].value + '%'
I'll post you an example tomorrow.</p>
GLO_FR
<p>Hi again,</p><p> </p><p>and here is a sample report base on the Classic Model db</p><p> </p>