SSRS Textbox Entry Limit Chars - tsql

I am looking for a way to limit the entry size of a textbox for an SSRS parameter. The report is being rendered in ReportServer 2008. To be clear, this is NOT a textbox rendered in the report.
The report is accepting a limited number of characters for a text search, and I would like the presentation layer to match the report/SQL logic entry limit. I do not want to get 100 chars passed into a VARCHAR(20) field and produce a silent error.
Thanks!

There is no option to limit the length directly. One possible solution would be to have the report return a warning message indicating that the parameter is too long instead of running the query. You can do this by adding a hidden parameter after the parameter in question to be used as a flag that determines the visibility of the objects on the report.

Related

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.

can grow field object in crystal reports

I'm working vb.net2010 and Crystal Reports for. NET Framework 4.0.
I have a text field in mysql db with RTF data, output the data to the report assigns by default a text field (IFieldObject).
The problem is that when the data exceed 4,922 words (with respect to microsoft Word) does not show the other data, I have activated the property can grow.
Could someone please tell me how I can show the rest of data are like a 2000 or 3000 words. Or Crystal Reports can not display more data.
Thanks in advance.
If you don't want to set a limit as to how many lines (not words) the report displays, make sure that when you set the "Can Grow" property to set the "Maximum Number of Lines" value to zero, which means there is no limit.
Cheers,
Chris
Since that doesn't seem to work, try right-clicking on the field, click on Format Field -> Paragraph tab -> Text Interpretation -> RTF text.

Subreport parameters not being used when 0 records

I have a subreport in a crystal report but there are 0 records returned, but the subreport insists on pulling every order remark ever entered yet still displaying 0 remarks.
It's very odd, it says "reading records 0 of 150000" and keeps increasing.
The subreports only selection critera is the company code, the customer code and the order number. they are all passed with the "{?PM-..." thing going on.
I opened a blank subreport's preview and the SQL didn't even make mention of the selection criteria. the query run by itself would indeed show every remark.
Any thoughts on how this can happen?
Subreport Formula:
({E_ORD_H.COMP_CODE} = {?Pm-E_ORD_H.COMP_CODE})
and
({E_ORD_H.CUST_CODE} = {?Pm-E_ORD_H.CUST_CODE})
and
({E_ORD_H.ORD_NUM} = {?Pm-E_ORD_H.ORD_NUM})
When a Crystal Report behaves like that it means that there is some logic that cannot be done on the DB server, so it must be done locally. Usually this is caused by using a CR function in the record selection formula that doesn't translate into the DB's language.
In this case, I believe it is when the parameters are null that is causing it (For example, the statement {E_ORD_H.COMP_CODE}=<null> does not mean that CR will be able to anticipate this situation and substitute {E_ORD_H.COMP_CODE} is null in its place in the subreport's query. Instead, you need to explicitly check for those null-valued parameters:
not(isnull({?Pm-E_ORD_H.COMP_CODE}))
and {E_ORD_H.COMP_CODE} = {?Pm-E_ORD_H.COMP_CODE}
and not(isnull({?Pm-E_ORD_H.CUST_CODE}))
and {E_ORD_H.CUST_CODE} = {?Pm-E_ORD_H.CUST_CODE}
and not(isnull({?Pm-E_ORD_H.ORD_NUM}))
and {E_ORD_H.ORD_NUM} = {?Pm-E_ORD_H.ORD_NUM}

SSRS no data in report

I have a single tablix on the SSRS report which fetches data from a stored procedure.
I am trying to show a meesage to the User when no data is present say, "** There is no data for this report*". I can do this easily by specifying this message in the **NoRowsMessage property of the tablix. But I want to show the headers of the tablix along with this message.
If I don't set the NoRowsMessage property, I get the headers but no message, but if I do, I get the message but no headers.
I need some help with this.
Note: I am using SSRS 2008.
Edit:
I can also put up a textbox with the relevant text message below the tablix and set it visible only if the tablix contains no rows. But I am not able to figure out as to how do I find out from the Visibility expression of the textbox whether the tablix contains any rows or not.
A tablix object is related to the underlying dataset, so if there's no data, there's no table in the output.
Other than using the NowRowsMessage property, the only other way I can think of to enforce this would be to ensure your query returns an empty value placeholder when there are now rows returned. This way you would have, in essence, a single data row.
You could then try and add a conditional expression on the table (i.e. on the Visibility property of the details row) to prevent any rows containing your placeholder from showing up.
So in your query you could have:
IF (##ROWCOUNT= 0)
BEGIN
SELECT
'[IAMEMPTY]' as [Col1]
,'[IAMEMPTY]' as [Col2]
,'[IAMEMPTY]' as [Col3]
END
And then in the Visibility property of your table's detail row:
=Iif(Fields!Col1.Value = "[IAMEMPTY]",True,False)
EDIT: Alternatively, to check if the DataSet is empty in SSRS and show a rectangle containing your message/headers (as mentioned in TooSik's comment), you could set up a rectangle with this in the Visibility expression:
=Iif(Rownumber("Dataset_Name")=0, False,True)

Field text is being truncated inconsistently

I created a label report (2 columns). The fields used are, Suffix, Contact Name, Company Name, Job Title and Department – simple contact data.
The Department field is the last one and in the report of 78 records the Department field decided not to display the entire field text twice.
I have "Can Grow" set as default on all fields, I checked the margins and label width to ensure the text is not being truncated because of the labels being too wide for the margins. I modified the data in the database by abbreviating certain words and it shows the change but it still truncates after 50 characters. Other times the Department name is 80+ characters and it displays all of the data.
This problem is happening onscreen when I preview the report and also when various users print it. The default printers have not changed.
This one has me stumped. Is this an application bug (if so is there a Service Pack for CR 11.5?) or does it have anything to do with printer drivers in need of update?
Thanks in advance for your help on this puzzle.
Update
I did specify data source
The text in the database is without any special characters or anythig else that might be out of place
No I am not using Underlaying Following sections anywhere in the document
11.5.8.998 is my version of CR (lloks like I am behind - however, when I click on verify for updates it tells me there aren't any. Do you ahve a link to the SP2 download?)
No formula in the Custom string option
Mine worked by simply going to the Database Menu option: Database-->Verify Database, and the field sizes were updated
It could happen if the length of the field in the Data Source is less than your string. To check this:
In the Field Explorer right click on the data source name and choose "Show Field Type"
The length of the field is written between ( ). If it is less than your string length, you have to re-build your data source. For example, if your data source is a view, you have to drop and create it again and then verify your data base in crystal report.
Hope it helps.
Random troubleshooting thoughts. One of these could even work :)
You didn't specify your datasource, but can you preview your data before it goes into Crystal? If the actual data is randomly truncated, then the problem isn't Crystal, it's the data.
Does this data have any special characters, i.e. accents, foreign currencies, etc? That could be a problem (I don't know if this could even create problems, never used them in Crystal)
In the Section Expert, are you using the Underlaying Following Sections option for fancy formatting? If so, your 'grown' fields may be hidden by some other field in the following section.
My Crystal Reports XI Developer Edition is 11.5.12.1838 (that's service pack 2). Is your Crystal up to date?
In the Format Field pane, there is an option to make a custom Display String. Sometimes I forget I have a formula and then don't understand why it's not doing what i want.