Telerik Reporting - Dynamic - telerik-reporting

In telerik reporting, is this possible to bind my data dynamically from database with space and special characters in telerik table column name? is there any alternate solution?

Telerik Reporting supports referencing the fields whose names contain spaces and special chars like that (sample expression):
=Fields.[My field'name]
You can also reference fields dynamically passing the name of the field using the Fields function (for example, pass the name using a report parameter):
=Fields(Parameters.FieldName.Value)

Related

SSRS: is there a way to display a multivalued parameter in a table?

Using SSRS 2012
I have a multivalue parameter in a report and I would like to make it the source of a table. Is there a way to accomplish this? I'm coming to the conclusion that one cannot make the data source of a table anything except a dataset.
I tried to make the multivalued dataset (source of parameter) filtered by parameter but that gives a forward reference error (makes sense).
I am now trying to set the visibility property on the table's single text box like this, so it will only make the values visible that are one of the chosen parameter values:
=IIF(Fields!MODALITY.Value = Join(Parameters!Modalities.Value,","),True,False)
but they are all shown (alway true?). Any ideas on how to show a list of the values picked from a multi valued parameter in the report as a table (not just a delimited string in a text box)?
The data source of a table will always be a dataset, but you can use the parameters in a dataset. Something like
select * from dbo.split3(#parameter)
where split3 is a csv to table function, like one found on http://blogs.msdn.com/b/amitjet/archive/2009/12/11/sql-server-comma-separated-string-to-table.aspx
I found an expression that works for changing visibility so that my table shows just the elements in the multivalue parameter that were selected. Perhaps there's an easier way.
=IIF(Instr(","+Join(Parameters!Modalities.Value,",")+",",","+Fields!MODALITY.Value+",") <> 0,False,True)

Naming sheets in SSRS when imported to Excel

I have put page breaks in my SSRS report. When report imported to Excel, report is divided into different sheets according to page breaks. Is it possible somehow name those sheets? Thanks for assistance.
You can easily change the tab name by setting the "Page Name" field on the properties sheet of the group (in this example "Buyer") that is providing the page break.
You can't do that with standard SSRS, but I know you can do it with OfficeWriter by SoftArtisans.
It's a proprietary application which isn't cheap, but it let's you create a template in Excel which you can then export the report into. You can do stuff like create charts and pivot tables as well which get populated automatically.
We have used their product and it works well. Their app can also be used to generate other Office artifacts such as Word docs.
(BTW I have no affiliation with SoftArtisans)
But how can I Name each tab with different names?
As Randy pointed out, the PageName is used to name tabs when a report is exported to Excel. Normally you would use a field name for the PageName expression.
If your page breaks are due to a Group, you would probably want to use the name of the group as the PageName. For instance, if you had a report of sales by customer with a separate tab for each customer, you would probably want to use the customer name field as the PageName expression.
=Fields!Customer_Name.Value
If you add the left(buyer,5) etc..into your dataset, put this as the initial group in your report then (page break between each instance of a group) and also use this field as the page name..should do the trick
Navigate to the tablix properties. Type the "SheetName" you need under "PageName" expression. It is better to assign this property from a Global variable, but if you need a custom set name for each of your Excel tabs, this is the way.

Searchable MultiSelect or the best approach

Users of a report have requested the ability to be able to manually enter a code, currently they are are presented a multiselect with all the codes related to the previous parameters.
This is in Report Builder 3.
This multiselect can become quite long so I thought another approach would be a searchable multiselect. Is this possible in any: way, shape, or form?
Could I allow for a cascading parameter (which is the code) to be either selected either through manual typing or another means.
I would add a type-in text parameter (lets call it Search_Code), with a default of % (assuming your data source is SQL).
Then in the data source for the Code list, I would add to the WHERE clause e.g.
WHERE Code LIKE '%' + #Search_Code + '%'
This will restrict the Code list to strings which partially match the Search_Code value (if entered).

SSRS csv export with comma in the column header names

By default, csv takes the text box name as the csv header name for the columns. The text box does not allow a space.
How do I make a different header than the text box for the csv?
Is there a way to display comma in the header when exported to csv?
Note: The solution has to be only for one report; not global.
The column name comes from the DataElementName property, or if that is blank, the Name property. Unfortunatly, neither allow commas or quoting.
There is a blog post here:
http://www.behindthecode.net/Blog/post/2008/01/29/How-to-modify-Reporting-Services-CSV-export-Behavior.aspx
on how to change settings in the config file for csv exports. These are global changes. The list of properties available is here:
http://msdn.microsoft.com/en-us/library/ms155365.aspx
None of these allow the spaces you need, or the quoting of column names that I am currently trying to achieve. Sorry.
In short, No, it's not possible.
From SSRS 2008 Column issue when exporting to a CSV file:
For csv export, the header of a column is determined by the DataElementName property of the textbox which actually contains the data. If the DataElementName property is not explicitly set by the user, DataElementName automatically gets defaulted to the value of the textbox.Name property.
That being said, I believe you're getting this issue because RDL has a restriction that both a reportItem.Name and reportItem.DataElementName property must be CLS-compliant identifiers. The headings like "Phone #", "Other Name(s)", etc... are not CLS-Compliant.
You can verify this by opening up the report in BIDS or RB and trying to set the DataElementName/Name property of the textbox containing the data to those names.
You will get an error which states the following:
Property Value is not valid. Specify a valid name. The name cannot contain spaces, and it must begin with a letter followed by letters, numbers, or the underscore character (_).
There is a Microsoft Connect Issue about this, but unfortunately it looks like it won't be acted on.
See: Use of expressions for DataElementName property (for CSV Export)
This solution works: https://stackoverflow.com/a/32110072/674237
In summary:
Modify your query to have the first row in the data set be your desired column headers. E.g., select header names and union them to the data set.
Add a new CSV rendering extension to the report server that excludes headers.
This workaround will let you to put whatever values you'd like in the headers.
Append the following query parameters to your url:
For # - [url]&rs:format=CSV&rc:FieldDelimiter=%23
For ; - [url]&rs:format=CSV&rc:FieldDelimiter=";"
Not sure you can do it directly from Report Manager without altering config files somewhere
Update: After rereading this, are you returning the column headers from the procedure like this?
SELECT tbl.colname [my column name, some text],
tbl.col2 [another, col]
The square brackets will allow you to escape characters.
Column names for Csv, Dbf and Xml are picked up from <Name> field by default.
Solved this issue by adding appropriate names for each of this formats in <Tag> field in *.mrt file. E.g:
<Name>Txt_InternalName</Name>
<Tag>CSV:"Name for Csv"; DBF: "Name for DBF"; XML: "Name for Xml"; Default: "Default Name for Csv Dbf Xml"</Tag>
Also it resolves issue with CLS non compliant identifiers in headers

Reporting Services - translating labels into different languages

I'm finishing up my reports in my SQL Server 2008 Reporting Services project, and as one of the last steps, I need to make things translateable.
Since I have a bunch of reports, and they all share some identical labels, I decided to put all those labels I need to show into a SQL Server table, and I am surfacing that contents as a DataSet dsReportLabels in my reports.
This DataSet basically contains two fields: LabelName is the name of the label (e.g. "Count of items"), and Caption contains the text in the chosen language to be shown on the report.
But now here comes my mental block: how do I assign the dsReportLabels.Caption value to a e.g. textbox, based on the dsReportLabels.LabelName ?
So I need something like (pseudo-LINQ statement):
Textbox1.Value = from dsReportLabels
where LabelName = "some value"
select Caption;
but how do I express that in a Reporting Services code snippet?
I know how to reference things like Parameters!MyParameterName.Value and so on - but that doesn't really work here when I'm trying to extract a value from one column of the DataSet, given the value of the other column in that DataSet.
I bet this is totally easy to do in the end.... just can't seem to wrap my head around this right now.... anyone out there know how to do this?
This MSDN blog post describes one way of doing it. Essentially:
Create a lookup table with the LabelID, Language, and Caption.
Create a Stored Proc that gets all of the labelIDs and captions for a specified language.
Store the results of the SP in a dataset.
Store the dataset in a multi-value parameter.
Use the multi-value parameter in a custom lookup function.
So, the expression in your label textbox would call the custom function with the labelID, which would get the appropriate caption for the appropriate language.
Report Server 2008 also has a built-in Lookup function that may allow you to skip steps 4 and 5. If this is the case, your expression would call the built-in lookup function, which would go directly to the dataset. I don't have RS 2008, so I can't test this.