Crystal Report - unable to use TEXT type as a parameter? - crystal-reports

I am currently developing a website, asp.net 4.0 using crystal reports, I can view the report perfectly etc, however when trying to create parameters in the report I am unable to select or even view TEXT type fields in my database table when selecting a field to create the parameter from. Selecting string or integers etc work fine, but all TEXT type fields arent even visible.
Any ideas as to why this may be? I need to add a parameter from a TEXT field as we want to limit the results to all messages which contain a certain phraze, and that message is stored in a sql database as a TEXT type.

You have to convert Text type into varchar(max) and then it will be show.
Otherwise you have to add Custom Parameter field and read this value into the parameter and this parameter will drag on your report design page.

You will need to create a parameter that is a 'String' type.
Next, cast your TEXT value to different type using a SQL Expression:
//{%converted_text}
(
cast( TEXT AS varchar2(255) )
)
You may need to adjust the syntax (I'm using Oracle's).
Finally, reference each in the record-selection formula:
{%converted_text} = {?text_prompt}

Related

Returned query values are different type in FastReport 4

I am trying to get a numeric value of my firebird sql query.
In IBExpert the data types are correct "Numeric(18,2)" but when it comes to FastReport it displays me not the Numeric18,2 datatype. It cuts the ,00 off.
Anybody who can help me?
Your data is retrieved properly, you need just to display it well formatted.
Set the display format of the text box as described in documentation.
If the text box contains different formats for multiple values you need to use inline formatting for each value.

Jaspersoft Studio: Force input parameter of subreport to be entered manually

In my main report I get a (small) list of string values from the data base. I then want to use this list for selecting records in a subreport, along with other input parameters:
The user shall be able to select records based on a range of begin and end date -- this is easy using an input parameter of type java.util.Date with "Is For Prompting" set to true. Another criteria shall be one or more items from a list showing values from a data base field. I could define the list in the report template, but then I'd have hard-coded strings (filled from the data base, but at definition time only).
Now the dilemma is: If I define the input parameters in the main report, I cannot get the values for the list beforehand; if I define them in the subreport, I get no prompt at all, so there's no way to set any of them.
So the report requires values for start and end date, and a list of string values to select from (multiple itmes can be selected). This list shall be built from values from the data base. In the subreport all these values shall be joined into a filter for the records. A user shall be able to define the dates and select items from the list manually before executing the report.
Is there a way to achieve this?
After some more hours of trial & error, and some more research, of course, I found that the keyword is "Query-based Input Controls". This documentation describes their creation on the JasperReports Server. Such input controls can be edited in Jaspersoft Studio as well, however, they actually work on the server only. Anyway, this is the solution to my problem.

Crystal reports - get crosstab column value from different table

I have a crystal report based on xml data with a crosstab for displaying the main set of data that I want.
Some of the values that I need to display in the header are in a dictionary 'table' in the xml and I need to extract the value of a field where the name is e.g. 'CrossTabColumnName'.
I can do this in a subreport and use a shared variable to put it onto the main report, but it won't let me put it in the crosstab because it 'has to be evaluated later' - fine I get the idea behind this but how can I get this value into where I want it?
I just want to be able to say, for example: Select Value From DictionaryTable Where Name='CrossTabColumnName', and put that into a field I can use in the cross tab.

how to avoid cascading in ssas parameters in ssrs report and load default "all" when report loads?

i have a ssrs report which uses ssas data source and all of the parameter in report also come from ssas data source. the problem is parameters are acting as cascading parameters. i can not have values in parameter drop-down until i select parameter from previous drop-down.
i wanted to have default value "All" selected when report loads instead of waiting for selecting first parameter and then load subsequent?
i have removed #parameters from parameter data source and now here is how my MDX looks like:
WITH MEMBER
[Measures].[ParameterCaption] AS [Category].[Category ID].CURRENTMEMBER.MEMBER_CAPTION MEMBER
[Measures].[ParameterValue] AS [Category].[Category ID].CURRENTMEMBER.UNIQUENAME MEMBER
[Measures].[ParameterLevel] AS [Category].[Category ID].CURRENTMEMBER.LEVEL.ORDINAL
SELECT
{
[Measures].[ParameterCaption],
[Measures].[ParameterValue],
[Measures].[ParameterLevel]
} ON COLUMNS ,
[Category].[Category ID].ALLMEMBERS
ON ROWS FROM
( SELECT ( [OwningEntity].[Entity ID] )
ON COLUMNS FROM
( SELECT ( [Organization].[Organization] ) ON COLUMNS FROM [PerformanceScores]
))
Create Additional data source , point your first parameter with default value "from query" to that data source - This parameter need to be on the top of the list as in SSRS order of parameters is important.
- Let me know if you got any problems.
Thanks
Daniel
Create hidden parameter with IIF statement in default value.
in IIF put dummy date - this will not execute the report but will fill all the other parameters.
IIF(yourparameter.value="",dummydate.value,yourparameter.value)
Use this hidden parameter as your "Main" data range but default value will depend on visible parameter value in IIF statement when user can choose the range
This should work...

numeric fields added with single quote in jasper generated excel file

I'm designing a jasper report with the field type & text field type as double.
When run the jrxml file using jasperreports4.7.jar for excel format,
it'll add a single quote in numeric columns.
so i can't do any numeric manipulation in excel.but same is working fine in jasperreports3.jar.
is anyone facing the same issue?
pls help me
What you need to do is to define the field you want to print as an Integer or Double. (You must set your Report to java)
If I do not know yet what type of field is comming I am making, lets say 3 fields, one String, one Integer, one Double. Then I pass the info the what it is dynamically to another -meta-field.
In the designer I lay all 3 fields over each other. Seems to work.