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)
Sending parameter values in URL
ajunuthula
Hi,
The report with parameters in URL is
http://wisdom.rockefeller.edu:8080/birt/frameset?__report=list0926.rptdesign&From(Year)=2012&To(Year)=2012&Author1=Coller&Author2=Wittkowski&Author3=Krueger
These parameter values are in a dropdown list and set as not required.
So for Author1 = Coller and Author2, Author3 set to Null Value,
http://wisdom.rockefeller.edu:8080/birt/frameset?__report=list0926.rptdesign&From(Year)=2012&To(Year)=2012&Author1=Coller&Author2=&Author3=
I can still see the default values, filter is not restricted to only Author1 value.
Attached is the report design for reference.
Thank you,
Aparna J
Find more posts tagged with
Comments
mwilliams
Can you explain more about the issue? I'm not sure I'm understanding.
ajunuthula
Hi,
Sorry for the confusion.
Bsically I am trying to assign null values to the parameters in the URL.
URL might look like,
http://wisdom.rockefeller.edu:8080/birt/frameset?__report=list0926.rptdesign&From(Year)=2012&To(Year)=2012&Author1=Coller&Author2=&Author3=
Howeever, Author2 and Author3 cannot always be null.
Thank you.
mwilliams
And what's not happening as you expect it to?
ajunuthula
when I run the URL
http://wisdom.rockefeller.edu:8080/birt/frameset?__report=list09.rptdesign&From(Year)=2012&To(Year)=2012&Author1=Coller&Author2=&Author3=
Then the parameters Author2 and Author3 are not taking the null values, When they are set to null then only Author1(Coller) results must be returned but this is not happening. All the other results are being returned.
Am confused as to how to assign null values in URL.
mwilliams
Ok. I'm with you now. The easiest way to do this will be to build your where clause based on the values of the parameters. If one comes through without a value, don't add that part to your qeury. You're already editing the query in your beforeOpen, you just need to go a bit further and only add a parameter to the query if it has a value.
ajunuthula
Hi,
I figured out a solution and it worked, following is the script I used in the beforeOpen
temp1="";
temp2="";
temp3="";
temp4="";
temp1=params["Author1"].value;
temp2=params["Author2"].value;
temp3=params["Author3"].value;
temp4=params["Author4"].value;
if (temp1== "")
{
temp1 = "&__isnull=Author1";
}
if(temp2=="")
{
temp2 = "&__isnull=Author2";
}
if(temp3=="")
{temp3 = "&__isnull=Author3";
}
if(temp4=="")
{temp4 = "&__isnull=Author4";
}
this.queryText = this.queryText + " where year between ? and ? and (authors like '%" + temp1 + "%' or authors like '%" + temp2 + "%' or authors like '%" + temp3 + "%' or authors like '%" + temp4 + "%') order by year asc ";
Thank you for all your help.
Thank you,
Aparna J
mwilliams
You are very welcome!