Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Report Parameter: display one value, storing another?
Elja
<p>Hey.</p>
<p> </p>
<p>Does anyone have an idea how to solve my problem: I'm trying to build a report parameter (multi value) so that it displays a value "service name", but stores a different value "serviceid".</p>
<p> </p>
<p>The reason for this is that service name is the informative field which users know and can make a selection out of. So Report parameter should show the service name and user should be able to select 1-n out of the displayed names.</p>
<p> </p>
<p>BUT: the service names might include commas (,) which seems to cause problems in storing the values. I'd like to store serviceid values instead for further use.</p>
<p> </p>
<p>I tried to figure out whether I could affect the stored value in before open -script but it's too late by then.</p>
<p> </p>
<p>SO: is it possible to present one type of values (string) in report parameter for user to choose from and according to the selection, store different type (integer) in the same report parameter? The data set I'm using for the representable values includes both name and id in the select -statement.</p>
<p> </p>
<p>My Before Open script -></p>
<p>First part that works:</p>
<p>this.queryText = this.queryText.replace("ostovoimat", params[RP_Ostovoiman_tila"].value.join("','");</p>
<p>This part doesn't:</p>
<p>this.queryText = this.queryText.replace("palvelut", params[RP_Palvelut"].value.join("','");</p>
<p>in this palvelut -part I should use the palveluid that's an integer..</p>
<p> </p>
<p>The main data set SQL includes the usage of string arrays as follows:</p>
<p><b>AND </b>ovs.tila <b>in</b> ('ostovoimat') <b>AND</b> p.palveluid <b>in</b> (palvelut)</p>
<p>-> ostovoimat works fine, palvelut not at the moment..</p>
<p> </p>
<p>Thanks in advance, Elja</p>
<p> </p>
<p>Ps. sorry about the little mistake in the topic, it seems I can't correct it after posting the topic.</p>
Find more posts tagged with
Comments
donino
<p>Why don't you simply use one report parameter, with "service name" as displayText, and "serviceid" as value column? This is precisely the purpose of the "displayText" property of a list parameter, and it would solve this trouble with commas.</p>
<p> </p>
<p>For the second part of the question, if you want to filter a list of integer values you need to remove the quotes around the comma:</p>
<p> </p>
<p><u>instead of this:</u></p>
<pre class="_prettyXprint">
this.queryText = this.queryText.replace("palvelut", params[RP_Palvelut"].value.join("','");</pre>
<p><u><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">use this:</span></u></p>
<pre class="_prettyXprint">
this.queryText = this.queryText.replace("palvelut", params[RP_Palvelut"].value.join(",");</pre>
Elja
<p>Hey Donino and thanks a lot for your tips.</p>
<p> </p>
<p>I seem to have forgot to mention that I'm trying to do this to a cascading parameter, but it seems to work the same way..</p>
<p> </p>
<p>I'll try the things you suggested!</p>
<p> </p>
<p>- Elja</p>
Elja
<p>Hey, some questions arouse when trying to make the report work (following the tips Donino gave me).</p>
<p> </p>
<p>1) Cascading Report Parameter: Value and Display can be different fields, but can they be of different data type?</p>
<p>I'd need to show (Display text = char field) to the user and store the Value (another field of integer-type).</p>
<p>When configuring the parameter, the data type has to be determined.</p>
<p>So: If display text and value -fields are of different data types, to which one does the configurable data type refer to?</p>
<p> </p>
<p>2) Before Open, current script:</p>
<p>this.queryText = this.queryText.replace("ostovoimat", params["RP_Ostovoiman_tilat"].value.join("','")); this.queryText = this.queryText.replace("palvelut", params["RP_Palvelut"].value.join(","));</p>
<p> </p>
<p>-> RP_Palvelut should be integer (type bigint in postgresql db). Is it enough to drop the '' from .value.join(","));?</p>
<p>Or should the whole this.queryText -sentence be further modified?</p>
<p> </p>
<p>3) In the SQL-statement:</p>
<p><b>AND </b>p.palveluid <b>in</b> ('palvelut')</p>
<p> </p>
<p>-> similar type of code worked with another Report Parameter (of string type).</p>
<p>Does integer type work differently?</p>
<p> </p>
<p>- Elja</p>
donino
<p>1) The data type refers to the value, and the displayText property is always a char expression. Therefore this should meet your needs: there are many situations where cascading parameters are incredibly useful, but i don't think it is necessary here. </p>
<p> </p>
<p>2) If i correctly understood, remove the filter on "ostovoimat": only the filter on "palvelut" is required. Since this field is an integer, you should also remove quotes in SQL:</p>
<p> </p>
<p><u>query:</u></p>
<pre class="_prettyXprint">
AND p.palveluid in (palvelut)</pre>
<p><u>beforeopen:</u></p>
<pre class="_prettyXprint">
this.queryText.replace("palvelut", params["RP_Palvelut"].value.join(","));</pre>
Elja
<p>Thanks a lot for your response once again, donino.</p>
<p> </p>
<p>1) Ostovoimat parameter is a stand alone Report Parameter which I need for acquiring 1-n values from a field (which luckily only has 4 possible values).</p>
<p> </p>
<p>2) I'm using 1 standalone Report Parameter (Ostovoimat, as described above).</p>
<p>I've also got 2 cascading parameters:</p>
<p>* Cascading report parameter 1: RP_Kunnat (cities in Finnish) -> user selects 1 city with this parameter, which is used in the next cascading parameter as a filter to fetch the services related to the selected city:</p>
<p>* Cascading report parameter 2: RP_Palvelut, which presents a list of values (services). It produces the service name (p.nimi, type character varying(150) in postgredb) and service id (p.palveluid, type bigint in postgredb).</p>
<p> </p>
<p>RP_Palvelut is linked to Data Set Palvelut, which filters p.nimi and p.palveluid values with the following SQL-command:</p>
<p> </p>
<p>SELECT DISTINCT<br>
p.nimi, p.palveluid<br>
FROM<br>
kuntahallinta.kunta k,<br>
kuntahallinta.palvelu p,<br>
kuntahallinta.palvelujarjestaja pj,<br>
kuntahallinta.palvelusisalto ps,<br>
kuntahallinta.ostovoimasisalto ovs<br>
WHERE<br>
p.palvelujarjestajaid = pj.palvelujarjestajaid AND<br>
pj.kuntaid = k.kuntaid AND<br>
ovs.palvelusisaltoid = ps.palvelusisaltoid AND<br>
ps.palveluid = p.palveluid AND<br>
ovs.toistuvuus <> 'EI_TOISTOA' AND<br>
k.nimi = 'Espoo'<br>
ORDER BY p.nimi ASC;</p>
<p> </p>
<p>-> the select distinct fields are used in the report parameter, p.nimi as the display text and p.palveluid as the value. I set the k.nimi (city) to a city name 'Espoo' for the moment. I'm going to change it to <strong>k.nimi = ?</strong> as soon as I get this script to work (which I hope will then use dynamically the first chosen cascading parameter city as filter for the second value).</p>
<p> </p>
<p>Now, I made the changes you introduced, that are necessary to make the integer work, but I still got an error (attached text file).</p>
<p> </p>
<p>I tried to configure both value types "Integer" and "Decimal" (suggested) for RP_Palvelut, but the same error appeared. Could this be still a field type thing?</p>
<p>As palveluid- field type is defined as bigint in postgresql database, but birt report parameter doesn't include bigint? Or is it ok to select INT as the matching type in Birt Report Parameter?</p>
<p> </p>
<p>
donino
<p>Ok understood. Yes, INT type should be fine here. This exception means at least one of the two parameters involved in beforeOpen script is null. Comment the script temporarily, and drag & drop these two parameters from the outline view onto the top of the report body: it will create 2 dynamic texts showing their respective values. Run the report, thus you will be able to find out what's going on.</p>
<p> </p>
<p>Furthermore you should set a default value to each of these parameters, especially RP_Palvelut: this would help birt to preview data and analyze a resultset sample. And this way the script will never fail due to a "null" exception, it will make easier to find out where you made a mistake</p>
<p> </p>
<p>I hope it helps</p>
Elja
<p>Thanks again, Donino.</p>
<p> </p>
<p>It seems I'm (rather slowly) advancing to get this script work. Big thanks to you! </p>
<p> </p>
<p>Now, maybe the type isn't the issue after all.</p>
<p>I checked your new tips with "RP_Palvelut" -Report parameter. The parameter seems to show the 3 correct palveluid -values that are produced by the data set "Palvelut" -> [357, 838, 839]. </p>
<p>They were shown on the top of the report along with the other "RP_Kunnat" -report parameters "city"-value.</p>
<p> </p>
<p>I configured the fist value "357" as the default value of "RP_Palvelut". For some reason the Error in "Before Open" script still seems to be the same: referring to null value.</p>
<p> </p>
<p>I'll attach some screen shots + files: 1. the report setup shown in birt, 2. the report parameter RP_Palvelut with the before open script, 3. the actual report showing the cascading report parameters on the top (below the title).</p>
<p>AND 4. a different Birt Error when I removed the "RP_Ostovoimat" part from the "Before Open" and "ostovoimat" array from the SQL-script:</p>
<p><strong><span style="font-size:10pt;"><span style="font-family:consolas;"><span style="color:rgb(127,0,85);">* AND</span></span></span></strong><span style="font-size:10pt;"><span style="font-family:consolas;"><span style="color:#000000;"> ovs.tila </span></span></span><strong><span style="font-size:10pt;"><span style="font-family:consolas;"><span style="color:rgb(127,0,85);">in</span></span></span></strong><span style="font-size:10pt;"><span style="font-family:consolas;"><span style="color:#000000;"> (</span></span></span><span style="font-size:10pt;"><span style="font-family:consolas;"><span style="color:rgb(42,0,255);">'ostovoimat'</span></span></span><span style="font-size:10pt;"><span style="font-family:consolas;"><span style="color:#000000;">)</span></span></span></p>
<p><span style="font-size:medium;"><span style="font-family:calibri;">* this.queryText = this.queryText.replace("ostovoimat", params["RP_Ostovoiman_tilat"].value.join("','"));</span></span></p>
<p> </p>
<p>Once again thank you Donino for helping me out with this.</p>
<p> </p>
<p>I guess the resolution lies in the before open -script, as the report parameter seems to have the correct int values. Maybe I'm not able to store 2 different this.queryText -sentences in row..</p>
<p> </p>
<p>- Elja</p>
<p> </p>
<p>Ps. Another related question: How is it possible to store a multi line script in before open (as many of the samples show)? I've been able to store only 1-line script, commands separated by ; -character.</p>
<p> </p>
<p>Attachments:</p>
<p>
donino
<p>Ok, so Palvelut parameter is fine. However as a second parameter to be checked i was thinking "RP_Ostovoiman_tilat" rather than "RP_kunnat", because in the script failing it is one one of the two parameters being replaced.</p>
<p> </p>
<p><strong>EDIT:</strong> i think i got it. In the rptdesign you attached, the parameter is named "RP_Ostovoiman_tila", whereas in the script there is a "t" at the end. This is why it returns null. You should make use of "drag & drop" feature from the palette to include parameters in a script</p>
Elja
<p>Hey again.</p>
<p>I couldn't find an attached rptdesign. BUT I think I might have used "RP_Ostovoiman_tila" -name earlier. Now it's been "RP_Ostovoiman_tilat" for a while. The reason for change is that it's supposed to be multivalue (t in the end is usually plural in Finnish) AND I've deleted the parameters for numerous times as I've tried many different approaches to solve this problem.</p>
<p> </p>
<p>But: I edited my response above and maybe my latest finding didn't stick out: I removed the working "RP_Ostovoiman_tilat" parameter -line from Before Open and the error produced was different (number 4 attachment above). Not the usual null-error anymore..</p>
<p> </p>
<p>Would you have an idea what it could indicate?</p>
<p>PLUS: how the heck can I create a multi line script in Before Open? I'm only able to write one line. Could it be because of the browser I'm using (IE 8)?</p>
<p> </p>
<p>- Elja</p>
donino
<p>You attached <em>Asiakkaan_Kokonaisuus_TEST.rptdesign</em> in another topic, this is where i found a difference between parameter names. Anyway this new error is a more common SQL issue. Did you preview the dataset without error in Eclipse designer? Usually when a parameter is an integer it is a better practice to set a valid value in the query statement, even if it will be replaced in beforeOpen. Thus we can preview data and check if the SQL statement is correct for birt, and if it is not the designer should give you more informations about the SQL error.</p>
<p> </p>
<p>For example in this case, i would have used something like:</p>
<pre class="_prettyXprint">
AND p.palveluid in (357,838)</pre>
<p>and in beforeOpen:</p>
<pre class="_prettyXprint">
this.queryText.replace("357,838", params["RP_Palvelut"].value.join(","));</pre>
Elja
<p>You hawkeye...
</p>
<p> </p>
<p>Yep, I've been around this same report a while and there've been quite a few issues with these dynamic report parameters.</p>
<p> </p>
<p>So, the name of the Report parameter has been changed a bit and it's now "RP_Ostovoiman_tilat".</p>
<p> </p>
<p>I've run all the Data Sets SQL -statments directly in the db via pgAdmin III.</p>
<p>* Data set "Palvelut" (yesterdays comment 1:51 PM) I run with fixed city (Espoo) where as I'll normally use RP_Kunnat and city = ? in the SQL.</p>
<p>* Data set "Asiakkaan_kokonaisuus" is the main data set. I'll attach the corresponding SQL to the end of this reply just in case it helps with solving the issue. I've run it also via pgAdmin with a few alterations:</p>
<p>city = * -> city = 'Espoo'</p>
<p>and I've removed the rules</p>
<p><b>AND </b>p.palveluid <b>in</b> (palvelut) <b>AND</b> ovs.tila <b>in</b> ('ostovoimat')</p>
<p>while running the script. It's been working fine. </p>
<p> </p>
<p>The thing you said about setting a valid value in Data Sets SQL -> it causes a problem.</p>
<p> </p>
<p>The service.name (p.nimi) and service.serviceid (p.palveluid) info is filtered in "Palvelut" Data Set.</p>
<p> </p>
<p>The report paramter usage shortly:</p>
<p>1) User selects a city (kunta). City values and selection is stored in Cascading parameter RP_Kunnat (which uses "Kunta" data set for city info)</p>
<p>2) User selects city's services via Cascading parameter RP_Palvelut: The chosen city info is used as a parameter in Data Set "Palvelut" for filtering the shown services according to the chosen city.</p>
<p>-> And hear is the problem: in the installment I'm trying to achieve, the "palveluid" values change according to chosen city, so I really cant have a set values to work with.</p>
<p>3) User selects Service bill state (stand alone Report parameter "RP_Ostovoiman_tilat", this is the third report parameter and it doesn't link to city or service. RP_Ostovoiman_tilat uses Data Set "Ostovoiman_tila" to acquire the 4 possible states to choose from.</p>
<p> </p>
<p>So, out of these 3, the RP_Palvelut has been the problem child. Do you think the problem lies with dynamic array which I'm creating? It just seems to work fine with chars, It'd be awesome to be able to use with integers too. </p>
<p> </p>
<p>I tried before to use the name of the service, but I bumped into errors once again. Maybe the names containing "," charactes messed the script up somehow. That's why I stared working with serviceid as it is simple integer (usually only 3 digits long).</p>
<p> </p>
<p>- Elja</p>
<p> </p>
<p>
donino
<p>In the SQL statement you attached there is a wrong additional "AND" between palveluid and tila. It might not be the only issue but it doesn't help
:</p>
<pre class="_prettyXprint">
AND p.palveluid in (palvelut) AND AND ovs.tila in ('ostovoimat')</pre>
Elja
<p>Hey. Yep, thanks for that too. I noticed it but forgot to remove from the script I sent as an attachment.</p>
<p> </p>
<p>What do you think of this part of the error-message:</p>
<p>"org.postgresql.util.PSQLException: ERROR: syntax error at or near ".357"<br>
Position: 547"?</p>
<p> </p>
<p>The palveluid values were: [357, 838, 839].</p>
<p> </p>
<p>Why is there a dot "." before value 357 in the error message? Is that part of the problem?</p>
<p> </p>
<p>- Elja</p>
donino
<p>hum. yep you are right, i missed this .357 seems to be the first value of the parameter :blink: . I wonder if there is a trouble related to the localization of the decimal symbol, or something like that. If you create a dynamic text in the report with the expression:</p>
<pre class="_prettyXprint">
params["RP_Palvelut"].value.join(",")</pre>
<p>does it at least display the expected comma-separated string?</p>
<p> </p>
<p>And what if you select one single value (only 357)? Does the query work like that? </p>
Elja
<p>hello again (and sorry for the absense, I was on vacation).</p>
<p>Unfortunately the problem still exists..</p>
<p> </p>
<p>I added a dynamic text with expression</p>
<p><span>params</span><span>[</span><span>"RP_Palvelut"</span><span>].</span><span>value</span><span>.</span><span>join</span><span>(</span><span>","</span><span>)</span></p>
<p><span>-> but it doesn't show on the report.</span></p>
<p> </p>
<p><span>As I select one value out of the services in "RP_Palvelut", only the 2 parameters I dragged and dropped show below the report title.</span></p>
<p> </p>
<p><span>The heading-row shows but no data..</span></p>
<p> </p>
<p> </p>
<p><span>- Elja</span></p>
Elja
<p>Hey.</p>
<p>Something happened and the dynamic text</p>
<p>params["RP_Palvelut"].value.join(",")</p>
<p>at the top of the report shows correctly (
donino
<p>Hi Elja, </p>
<p> </p>
<p>Most of beforeOpen scripts are multiple lines and work finely, i don't see why you face troubles with this in your context but it might be a clue for the query issue. Could you try the following:</p>
<ul><li>Store your final query in a global variable "query" such below (in this case it does not need to be declared before)</li>
</ul><pre class="_prettyXprint">
try{
this.queryText = this.queryText.replace("ostovoimat", params["RP_Ostovoiman_tilat"].value.join("','" ));
this.queryText = this.queryText.replace("palvelut", params["RP_Palvelut"].value.join("," ));
query=this.queryText;
}catch(e){
query="Exception:"+e.message;
}</pre>
<ul><li> At <strong>the end of your report body (</strong>or at least after the element using the involved dataset), add a temporary dynamic text displaying the query. Just enter as expression:</li>
</ul><pre class="_prettyXprint">
query;</pre>
<ul><li>If the query is correctly displayed at the end of the report, copy it and try to run it directly in your postgresdb client. Let us know if this generated query is correct. </li>
<li>If the query is not displayed at the end, then something wrong happened in the script, however the dynamic text should give some clues because we caught possible error messages.</li>
<li>if the dynamic text is not displayed at all, it means the engine stopped the generation of the report before creating the dynamic text when it encountered a problem with postgres, In this case you would need to log the queryText at the end of beforeOpen script. There are a couple of topics describing how to log from a script. A better option would be to run the report using the "debug" perspective but it is more tricky. </li>
</ul><p>I hope it will help.</p>
Elja
<p>Hey again donino.</p>
<p> </p>
<p>By the way, I've managed to get the report out now, even though the main data set still gives the null join -error.</p>
<p>I made a slight change (though I still wonder whether that made any difference) to the before open -script:this.queryText = this.queryText.replace("ostovoimat", params["RP_Ostovoiman_tilat"].value.join("','" ));this.queryText = this.queryText.replace("palveluidt", params["RP_Palvelut"].value.join("," ));</p>
<p>* I changed the name "palvelut" to "palveluidt" because the name palvelut was already in use as a data set name.</p>
<p> </p>
<p>About the global variable:</p>
<p> </p>
<p>I'm also not sure if I managed to place the script you gave in correct location. I searched the Birt documentation for global variables and learned it can be set in initialization of the report.</p>
<p> </p>
<p>1) So I inserted in the report - design - property - Initialize:</p>
<p>try{this.queryText = this.queryText.replace("ostovoimat", params["RP_Ostovoiman_tilat"].value.join("','" )); this.queryText = this.queryText.replace("palvelut", params["RP_Palvelut"].value.join("," )); query=this.queryText;}catch(e){query="Exception:"+e.message;}</p>
<p> </p>
<p>-> again I had to modify the script to be expressed on 1 line, cause I don't know how to write several line scripts in property value.</p>
<p> </p>
<p>2) I added the dynamic text "query;" to the end of the report.</p>
<p> </p>
<p>The report opened normally, but unfortunately the dynamic query -text at the end produced the following error:</p>
<p> </p>
<p>"The report opened normally</p>
<p>Exception:Cannot call method "replace" of undefined"</p>
<p> </p>
<p>Thanks for your help, Elja</p>
donino
<p>Oh i see, you make use of a property field to set the script... This is not the right way, see the screen below:</p>
<p> </p>
<p>
Elja
<p>
Nice.</p>
<p> </p>
<p>Thanks a lot for straightening that for me. That's the place I've been searching for.</p>
<p>* Now, I transferred the script to beforeopen:</p>
<p> </p>
<p>try{<br>
this.queryText = this.queryText.replace("ostovoimat", params["RP_Ostovoiman_tilat"].value.join("','" ));<br>
this.queryText = this.queryText.replace("palveluidt", params["RP_Palvelut"].value.join("," ));<br>
query=this.queryText;<br>
}catch(e){query="Exception:"+e.message;<br>
}</p>
<p> </p>
<p>* And the result seems to be the main data sets (Asiakkaan_kokonaisuus) SQL-query, the whole result down below but the most interesting right here: AND ovs.tila in ('MYONNETTY','AVOIN','LUONNOS','SULJETTU') AND<br>
p.palveluid in (357,838,839)</p>
<p> </p>
<p>-> so the correct id.s do appear here too (in p.palveluid array).</p>
<p> </p>
<p>I also opened up the main data sets SQL-query and with the latest changes the error message is now different:</p>
<p>
donino
<p>Now the error seems to be a common postgres SQL issue. That sounds much better, but you forgot to mention the most important point: if you copy this generated query and run it on your database through a postgres client, does it work? If so, i don't see what could be the problem :wacko:</p>
Elja
<p>Hey and sorry about that.</p>
<p> </p>
<p>I ran the query in pgadmin 3. After making a slight change to the script it worked fine. The part "WHERE kk.nimi = 'Espoo'..." was originally kk.nimi = ? (replacing the variable with a city name).</p>
<p> </p>
<p>Query:</p>
<p> </p>
<p>SELECT h.sukunimi ||' '|| h.etunimet AS Asiakas, ov.tunniste AS OV_tunniste, ovs.myontajannimi AS Myontaja, p.nimi AS<br>
Palvelu, p.palveluid, ps.nimi AS Palvelusisalto, ovs.arvoperyksikko, ovs.yksikoitamyonnetty AS MyonnetytYksikot,<br>
pt.yksikoitakaytetty AS KaytetytYksikot, ovs.tila AS Sisallon_Tila FROM Kuntahallinta.kunta kk, Kuntahallinta.kunta_asiakas ka,<br>
Kuntahallinta.asiakas asi, Kuntahallinta.henkilo h, Kuntahallinta.ostovoima ov, Kuntahallinta.ostovoimasisalto ovs,<br>
Kuntahallinta.palvelu p, Kuntahallinta.palvelusisalto ps, Kuntahallinta.palvelutapahtuma pt WHERE kk.nimi = 'Espoo' AND kk.kuntaid =<br>
ka.kuntaid AND ka.asiakasid = asi.asiakasid AND asi.henkiloid = h.henkiloid AND asi.asiakasid = ov.asiakasid AND<br>
ov.ostovoimaid = ovs.ostovoimaid AND ovs.tila <> '' AND ovs.tila in ('MYONNETTY','AVOIN','LUONNOS','SULJETTU') AND<br>
p.palveluid in (357,838,839) AND ovs.palvelusisaltoid = ps.palvelusisaltoid AND ps.palveluid = p.palveluid AND asi.asiakasid =<br>
pt.asiakasid AND pt.hyvitys = FALSE AND ((date(ovs.voimassaoloalku) BETWEEN '01.11.2014' AND '30.11.2014') OR<br>
(date(ovs.voimassaololoppu) BETWEEN '01.11.2014' AND '30.11.2014') OR ((date(ovs.voimassaoloalku) < '01.11.2014') AND<br>
(date(ovs.voimassaololoppu) > '30.11.2014'))) AND (date(pt.alku) BETWEEN '01.11.2014' AND '30.11.2014') ORDER BY<br>
Asiakas, OV_tunniste;</p>
<p> </p>
<p>- Elja</p>
donino
<p>Great, glad to here it! So after fixing this parameter in the dataset your report is working finely now?</p>
Elja
<p>Unfortunately not..</p>
<p> </p>
<p>the p.palveluid is defined differenty in this recent query: "AND p.palveluid in (357,838,839)". I'm trying to get the values to work with cascading report parameter "RP_Palvelut".</p>
<p> </p>
<p>As this part of the query is always true, it doesn't matter what's chosen in the User Interface into RP_Palvelut: the resulting report is the same.</p>
<p> </p>
<p>The basic problem still exists: how to get the value/values chosen with parameter RP_Palvelut to work with "Asiakkaan_kokonaisuus" data set (with no warnings)..</p>
<p> </p>
<p>Well, the report IS ACTUALLY WORKING now, but it still gives the "join of null" warning,when I close the main data sets edit mode.</p>
<p>The thing that might have helped is that I renamed the variable "palvelut" to "palveluidt" inside the SQL -script (one of the data set's also called "palvelut").</p>
<p> </p>
<p>- Elja</p>
Elja
<p>Hello again.</p>
<p> </p>
<p>I'm still suffering from the problem with report parameter usage, in particular transferring int -type values as arrays into the report.</p>
<p> </p>
<p>Before: I managed to pass 2 multi value Report parameter values into the report, using before open script:</p>
<p>this.queryText = this.queryText.replace("ostovoimat", params["RP_Ostovoiman_tilat"].value.join("','" ));<br>
this.queryText = this.queryText.replace("palveluidt", params["RP_Palvelut"].value.join("," ));</p>
<p>-> and added another int type multi value report parameter:</p>
<p>this.queryText = this.queryText.replace("asiakasidt", params["RP_Asiakkaat"].value.join("," ));</p>
<p> </p>
<p>The string type is fine, but using either / both of the int type parameters (RP_Palvelut / RP_Asiakkaat), Birt still gives the error:</p>
<p>***</p>
<p>" + this.queryText = this.queryText.replace("ostovoimat", params["RP_Ostovoiman_tilat"].value.join("','" ));<br>
this.queryText = this.queryText.replace("palveluidt", params["RP_Palvelut"].value.join("," ));<br>
this.queryText = this.queryText.replace("asiakasidt", params["RP_Asiakkaat"].value.join("," )); + "<br>
<br>
A BIRT exception occurred. See next exception for more information.<br>
TypeError: Cannot call method "join" of null (<inline>#1)</p>
<p>***</p>
<p>when valuating the main data sets SQL statement.</p>
<p> </p>
<p>Last time I managed to create the report, but now the main Data Set shows no data fields to select into the report. They all disappear if I have the following part inserted in the SQL:</p>
<p>"AND p.palveluid in (palveluidt) AND asi.asiakasid in (asiakasidt)"</p>
<p>When I remove this from the SQL, data fields appear below the Main Data Set as expected.</p>
<p> </p>
<p>Is there a problem with using int -type values with report parameters? I tried to pass a single int type inside SQL, like "asiakasid = ?", but I didn't manage that one either.</p>
<p> </p>
<p>Could someone still help me with this problem? Should I continue with this problem under another topic (for example</p>
<a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/35730-report-parameter-multiple-value-problem/'
title="View result">Report Parameter - Multiple value problem</a>
<p>, or create a new one?)</p>
<p> </p>
<p>- Elja</p>