Accessing metadata in Fetch-based reports - ssrs-2008

In reports I need to show localised field labels and entity names. For this I need to retrieve some pieces of metadata, namely -- localised entity names.
Can you access metadata in Fetch-based reports? If you can, how severely will performance suffer?

There is a hack to sort of get pick list values and default labels. Quoting from reference:
You must use the distinct clause, and create a seperate dataset to
fetch only the option set field like this.
<fetch version="1.0" output-format="xml-platform" mapping="logical"
distinct="true"> <entity name="account">
<attribute name="accountratingcode" /> </entity> </fetch>
This actually returns 2 columns to BIDS -
accountratingcode
accountratingcodevalue
Create a report parameter for the main report and in the Available
Values tab specify:
Get Values from a query
Dataset: Seperate Dataset with the Fetch XML
above
Value Field: accountratingcodeValue
Label Field:
accountratingcode

Sorry to say that entity metadata is not exposed via the FetchXml interface as neither "attributes" nor their corresponding "labels" are entities, so cannot be queried.
You can prove this by using the FetchXml builder ([details of getting it and making it work with CRM 2011 are here][1]). You will note that none of the available entities contain the information you seek.
Edit: looking at the core requirement (rather than answering the question in isolation as I originally did), it is possible to include "label" values in FetchXml statements, as #skfd notes in his own answer.

Related

Get the relations between dimensions and measure groups

There is the "Show fields related to:" feature in Excel:
I want something like this, but return in the following form:
MeasureGroup1: Dimension1, Dimension2, Dimesion3
MeasureGroup2: Dimension2, Dimesion3
...
Can't find out how Excel retrieve this data. I need to write a script which will automatically generate the relationship data for a chosen cube. It can be MDX or XMLA. ADO.NET in the last resort (it should be a portable script after all).
Hope you can help.
The following returns a recordset which Excel uses to determine which dimensions are related to which measure groups:
select *
from $system.MDSCHEMA_MEASUREGROUP_DIMENSIONS
Plus the xmla solution:
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>MDSCHEMA_MEASUREGROUP_DIMENSIONS</RequestType>
<Restrictions />
<Properties />
</Discover>

SharePoint 2010 - is it possible to populate a dataform web part with REST?

I have a custom page in SharePoint 2010 that is using a DataFormWebPart to display data from a very large list (almost 5000 items). I have a query defined in XSL in the DataFormWebPart that is querying data from the list. When I increase the size of the list to over 5000 items, I get an error saying that I'm exceeding the list view threshold.
I'm using a simple CAML query to filter the data from the list. My query should never return even close to 5000 items. I've got indexing turned on for the columns that I'm filtering on in the query. I'm not sure what else to try at this point, except to possibly try a different data source.
Is it possible to replace the SPDataSource call to the list with a REST call?
edit: Here's the CAML query
<Query><Where><Contains><FieldRef Name='Location' /><Value Type='Lookup'>{$Location}</Value></Contains></Where></Query>
Alright, here's what I've discovered.
Filtering against the text value of a lookup column does not work in a CAML query vs a list that has surpassed the list view threshold.
It appears that indexing a lookup column only indexes the lookup IDs of the column values, not the lookup values themselves.
You can, however, filter against the lookup ID of the lookup column in your CAML query.
Example: Filtering on Timbuku
For example, let's say you want to query for any items with their Location lookup column set to "Timbuktu".
You might use this query:
<Where>
<Eq>
<FieldRef Name=\"Location\" />
<Value Type=\"Lookup\">Timbuktu</Value>
</Eq>
</Where>
That query will work up until the list reaches the list view threshold of 5000, at which point it will fail, even if the Location column is indexed.
To work around this, you can find Timbuktu's corresponding item in the foreign list and determine its ID. Let's say it's 42. You can then use the ID number in the query like so:
<Where>
<Eq>
<FieldRef Name=\"Location\" LookupId=\"true\" />
<Value Type=\"Lookup\">42</Value>
</Eq>
</Where>
Note the addition of the LookupId=\"true\" in the FieldRef element.
That will work even after the list view threshold is surpassed.
What this means for you
Overall, it's not good news for your web part.
You would need to first query the locations lookup list for any items corresponding to the desired value, then use the IDs of those items to filter your actual data.
This actually isn't too tough to do programmatically, either with REST or the JavaScript Object Model, but it means you'll likely need to scrap the existing XSLT web part.

Jasper REST pass collection as parameter

I have a report which receives a List parameter to use it in a IN clause:
$X{IN, personID, _personID}
The report works when running it through the web application or remote repository view in iReport.
Now I need to call it using the REST api. I have tried several different ways of passing the list value in my resource descriptor but none of them worked.
<resourceDescriptor name="Test_Report" wsType="reportUnit" uriString="/Test/Test_Report" isNew="false">
<parameter name="_personId" isListValue="true"><![CDATA[1]]></parameter>
</resourceDescriptor>
The above example returns the following error:
Invalid type java.lang.String for parameter _personId used in an IN clause; the value must be an array or a collection.
I have also try the following:
<parameter>
<name>_personId</name>
<value isListValue="true">
3
</value>
</parameter>
But this returns a report with all the records, not only the person with Id=3.
My workaround for this problem was to use the REST V2 services of JasperServer.
Added to this the V2 has two advantages over the first version of the service:
it doesn't require a resource descriptor
it runs and exports the report in a single GET request
All the information required to run and export the report is passed through the request URL, for example:
<host>/rest_v2/reports/Test/TestReport.html?_personId=3&_personId=4&_personId=5&_personId=6
Your approach is totally fine, but there is also another small tip with collection type arguments ( might be a bug)
If you have more than 1 item in the collection this is totally working correctly:
(3,4,5,6)->?_personId=3&_personId=4&_personId=5&_personId=6
If you have only 1 item in the collection you have to add empty one too:
(3)->?_personId=3&_personId=
By the way, I am using Jasper Server CE 7.2.0 on the docker.

Jasperreport parameter selection from SQL query

I wanted to create a JasperReport which asks the user for a deliverer before it creates a report with data of the last the deliveries of the selected deliverer.
The problem, how I can do that? I found only examples where a parameter is created and the ArrayList is filled statically. But in my parameter I need the query result over the table of deliverers filled.
Can anybody tell me a possible solution?
I'm using Jaspersoft Server 5.1 which directly access a PostgreSQL database which has a datawarehouse structur. So it's not possible to use Java code.
Here is the documentation for adding input controls to reports in JasperReports Server:
http://community.jaspersoft.com/documentation/jasperreports-server-user-guide/adding-input-controls
Scroll down to the section that deals with query-based input controls. Your input control will have a name, such as deliverer. In your report, you must add deliverer as a parameter and reference it in your query, as you have done in your comment.

Two SQL query inside single JasperReport and populating Data

We are using reports in our web application.
The report is generated using JasperReports.
The problem I am facing is:
My SQL query fetches data based on a where clause:
SELECT * FROM table WHERE level='c'
I can easily show this information inside the iReport.
But I need to fire another query where level='d' and the information for the same needs to be appended to the report with that of level='c'.
I tried grouping both the outputs. But problem is how do I fire two different query while generating the report because I can write only one query in QueryBuilder inside the iReport.
Is there anyway of achieving the same.
In essence:
The report should look like:
Level=C
Name Age Phone number
Level=D
Name Age Phone number
Level D should appear only after level c is completed.
Can anyone please guide.
I finally managed to achieve the same..Grouping the data using level_id..
Initially I was trying to group in a different manner and hence the value was not getting shown..
The same is explained pretty nicely in ireport Ultimate guide-3 document.