Crystal 2013 - Is field in field possible? - crystal-reports

i am creating a template for an invoice-document. There are some text-blocks i want to include from external via DB-Field so that i can manipulate the text without changing the RPT-File. As some of the Text-Block also inlude VARS i was wondering if there is a chance to also include the VAR itself into the text-block, meaning we have a Field including a Field.
Is this possible? My first tests failed as the Name of the Var is interpreted as text and just printed but not changed into the VAR-Value.
--- Edit ---
Example:
Database-Field: {Table1.Value} -> 4.00
Database-Field: {Table1.Text} -> 'The value is {Table1.Value}'
If i now add {Table1.Text} into the report, it should show as "The value is 4.00"

Yes this is possible. Create a regular text box and set its text. Then drag a database field or a formula from the field explorer on the text box.

Related

How to seperate prefix from a dynamic text before printing in BIRT

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;

How to link an Input Control to a report's Parameter

I'm unable to link an Input Control to my report's Parameter. I feel I'm doing right, but I can't see the desired result in the final report.
My intention is to create a list, filled by some options, and display the list in a report as a parameter, so the user can (multi)select the options. As far as I know, I must create an Input Control on the server, create a Parameter on the report using the same name between the Input Control and the Parameter.
I've created a List of Values named ListaCalificaciones as follows:
Then, this is the Input Control:
Finally, this is the parameter:
However, when it comes to show the report on Jasper Server's web interface, I can't see a filled input:
Am I missing something?
By the way, I'm using Jasper Studio 6.6.0 and Jasper Server 7.1.0 (compiled version 20180504_1307).
Edit 2018/10/05 13:04
I've changed the input control, so that the id is ic_calificaciones and the name stays as it was (Calificaciones). I've found a way to make it work. First, I deploy the report to my server (local server in my case). Then, I edit the report, go to "Controls and resources", remove the ic_calificaciones parameter and add a InputControl parameter to the report. That way the Calificaciones parameter gets filled up with options.
I found the solution, it was just in front, but due to a poor UI I just didn't realise...
You must edit your parameter's name to match the Input Control's name, in my case it ought to be ic_valoracion. Then, the parameter-to-input-control-binding has to be made when publishing the report to the server.
So, being in Jasper Studio, click on publish button, as seen in the following picture:
Now, select the location where to publish the report. Then, the second step is what we're looking for, it's the place where you must select the resources to publish. As seen in the next image, you must edit your parameter's type to select "Link To Resource", click on whichever place and a new prompt will appear. Now, there, select the desired Input Control.
Finally, test your report.

How to use Parameter field in a record selection "like" statement?

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

CRM 2011+ SSRS Report + Currency Formatting

I have created a ssrs report in CRM online using BIDS.
Generated well but those currency field which is negative shows on the report with bracket.
All positive currency fields showing well on the report but negative currency field is showing with bracket like "(value)" on the report.
May do this like "-$value" or something else.
Please help.
You need to change the settings inside the placeholder properties, right click on the field in Design mode and you can choose also the format for negative values
You can try setting the textbox Format property using an explicit format string, something like:
$#,#;-$#,#;$0
To edit a textbox Format property click on the textbox then edit the Format value in the Properties tab:

How to add a simple text label in a jqGrid form?

When using the Add or Edit form from the pager I'm wondering how a simple static label can be added in the form without it creating any additional columns in it's affect on colNames[]'s and colModel[]'s. For example I have a quite simple typical Add form which opens from the pager containing a few label's and form elements: Name, Email, Web Site, etc., and then the lower section of the form has a few drop down menus containing the number 1 through 10 with the idea being to ask the user to pick a value between 1 and 10 to put a value on the importance to them about the product or service which is listed beside it. Just above this section I want to add some text only to give a brief instruction asking the user to "Choose the importance of the following products and services using the scale: [1=Low interest --- 10=Very high interest]". I cannot figure out how to get a text label inserted in the form without having to define a column with a formoption{} etc which is not needed for just some descriptive text. I know about the "bottominfo: 'some text'" for adding text to the bottom of the form but I need to insert some text similar to that mid-way (or other positions) in the form without it affecting the tabular structure of the grid. Is this even possible? TIA.
You can modify Edit or Add forms inside of afterShowForm. The ids of the form fields are like "tr_Name". There consist from "tr_" prefix and the corresponding column name.
I modified the code example from my old answer so that in the Add dialod there exist an additional line with the bold text "Additional Information:". In the "Edit" dialog (like one want in the original question) the input field for one column is disabled. You can see the example live here. I hope that a working code example can say more as a lot of words.