I'm creating a report which has as input parameters: id and name. These parameters are used in the where clause of the select from which I get the records to display in my list.
The problem is that if there is a + sign into the name the parameter (that I print on the page to display the filter) name appears with a space instead:
Input parameter = "record+story"
Parameter shown in report: "record story"
So the result of the select is empty, since the name doesn't match!
What am I missing?
EDIT: I open the report through a client application, based on VB6. There is a main page with a table and a list od ids, when I click on a row of the list it redirects me to an IE page performing the filtering and showing only the needed data.
The parameters are: id - Integer, and name - text.
When it opens the IE page I see that if the name contains a plus sign there appears instead a space, which of course is wrong, therefore the resulting report is empty.
I already tried to add the System.Web reference to VB6 in the client application, but it doesn't work.
Here a picture to clarify what I mean.
Thank you
C.
In the end I got the solution. I only need to encode my parameter so that the + sign is read as a + sign. This is achieved by using the hex value in the code behind:
example: namewithplussign ==> replace(namewithplussign , "+", "%2b")
Related
The name which i want to print in the report as a dynamic text is in the encrypted format in the DB. I decrypt this name with the help of the following script in onCreate of this dynamic text field.
this.text=Packages.com.erp.util.EncryptUtil.decrypt(name);
Now the problem is, this name comes with the prefix Mr,Ms etc concatenated with the name in some reports which is affecting the name decryption, I want the name alone for decrypt. Separating the prefix and name in query is disturbing the binding and leads to some other errors. So what i want to do is check the name for any space or split so that i can identify after the 1st space whatever coming would be the name and before space would be prefix. Then i want to send that name alone to the decypt method and on returning decrypted name should concatenate with the prefix using some script and print in the dynamic text field. How to achieve this in the BIRT Report Designer Version: 3.7.1.v2
From DataSet Drag and drop the name attribute into the report somewhere and make it invisible. Go to the onRender of that name attribute which available from the script tab in BIRT and paste the following code to separate prefix from name and send the name alone to your method.
name = this.getValue();
var sArr = name.split(" ");
name="";
for(var i=1;i<sArr.length;i++){
if(sArr[i]!=null)
name = name+" "+sArr[i];
}
name = name.replace(/^[ ]+|[ ]+$/g,'')
name=sArr[0]+" "+Packages.com.yourpackagename.yourmethodname(name);
Now drag and drop the dynamic text from the palette to the position where you want see the name. Go to the onCreate of that dynamic text field which available from the script tab and paste the following code to print the result which returned from your method along with the prefix.
this.text=name;
I have a group header which contains a title, a short description and then in the details band I print out the content.
I've set it up so that for each new group (grouped by title) it should start on a new page. Now I want to make sure that I don't print the title and the short description if I don't have any content related to it. So I've made a field which checks for a unique id in the content and use that field in the group band properties print when expression and in my details band print when expression.
And that works, I no longer print the title and short description if there is no content related to it. Here's the problem, with this setup I get a lot of empty pages inside my report where it originally printed the title and short description without content. If I remove the Start New Page option in my group I no longer get these empty pages. So somehow my group starts a new page before checking my print when expression, then checks it and decides not to print the groups content.
Have I've done something wrong or is there any way to bypass this behavior?
Instead of using the Start New Page setting in the group I used a break element with a Print When Expression, this does exactly what I thought the Start New Page option would do.
I have designed a report to pull data fields based on a record selection formula that uses a "like" operator that looks for a substring match in a particular field's data, as so:
{rct.serno} like "*9842*"
(due to the free-format way data is stored in the given field, I have to do a substring match to find the relevant rows in the DB.)
This works fine. Instead of manually editing the record selection formula every time, though, I thought to use a Parameter field ("{?TagNum}") to prompt the user for the desired string, and then use that in the record selection formula like:
{rct.serno} like "*{?TagNum}*"
Crystal does not throw an error when I save this record selection formula, but it does not return any records after the report is refreshed, and a parameter value is entered. How can I properly use the parameter value in a record selection substring match?
You're really close to the solution. You can modify the formula in the Select Expert. Just click the Select Expert icon (or from the Report menu). Then click the Formula Editor button. Concatenate or add an asterisk onto the beginning and end of the parameter using the + operator, like this:
{Customers.LastName} like "*" + {?pLastName} + "*"
Let me know if that helps.
~ Nathan
I've used worksheet URL actions in tableau before and they are Great! But I have a case where to construct a valid link- I need the field twice.
something like....
"http://wwwin-esstools-prd.cisco.com/pmt/emailfilters/EmailFilter.json/?&id=FIELD&queryObj={"conjunction":"and","expressions":[{"op":"equals","attr":"id","value":FIELD}],"preFilterQuery":"","name":"Advanced Filter"}"
where FIELD is the field name I would like to use to properly construct the url. I have tried using both the select and menu options-
both seem to be ignored by tableau.
FIELD needs to be surrounded by angle brackets. You can use the Insert menu on the URL action dialog panel to insert field names into your URL if you prefer, and thus avoid spelling errors. Or simply type the field name and brackets where you want them.
Recently I got some help with grouping when a user enters a null value into an input control ("Rolling up" groups in Jaspersoft iReport). I am using iReport/JasperServer Professional 4.5.1. My three levels of grouping are pharmacy, facility, and packaging type.
After deploying the report to JasperServer, I am having some trouble with nulls. I unchecked "always prompt" for my input controls, and when the report opens the first time it acts as though it has received null values for all input controls and groups appropriately (which is what I want). The display mode for my input controls is "in page", so they're displaying on the left-hand side of the screen. When I then try to select one pharmacy and re-run the report (expecting aggregate values for facilities and packaging types, since I didn't select anything for those controls), the report performs like the aggregate code doesn't exist, and lists all facilities and all packaging types.
However - if I save that one selected pharmacy as a saved input control, then go back out to the repository and run the report using the saved input control, it works fine, and aggregates all facility and packaging type data.
Any thoughts?
Thanks,
Lisa
My input controls are multi-select queries and my parameters are collections. I discovered that when I first entered the report by clicking on the link in the Repository, the report was being sent null values. However, when I was trying to run the report again after opening it in JasperServer, I was generating empty lists.
Matthew Dahlman suggested I create parameters in iReport to handle null values and "roll up" my grouping. Those parameters looked like:
$P{packtype}==null ? " 'All Package Types' " : " FAC.PACKTYPE_CODE "
That works beautifully in iReport and on first opening the report in JasperServer. To handle an empty list AND null values, I had to change my parameters to:
$P{packtype} == null ? " 'All Package Types' " :
($P{packtype}.isEmpty() ? " 'All Package Types' " :
" FAC.PACKTYPE_CODE ")