SSRS Report in 1:N relation - ssrs-2008

Please guide me about this. I am working on CRM online.
I need report(custom SSRS) which will be invoked from Campaign and it will print all the Leads belongs to that Campaign.
How should i achieve this.
I created a master report based on Campaign, and a child report which is added inside that master report using BIDS.
I am passing campaignId to the child and child report does it work simply.
Is it possible using single report instead of two report...??
Any help would be appreciated.
Thanks

You can create a single report, isn't mandatory to use the Parent-Child relationship that is available with Dynamics CRM.
Inside your report you can create how many dataset you want, just define a dataset with a query (built with FetchXml because you are using CRM Online) that will fetch for the related leads of the selected campaign.
You can use Advanced Find to get the FetchXml to start.
Example:
you have the FetchXml from the Advanced Find, this will retrieve all the leads with the attribute new_campaignid as the selected GUID value.
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="lead">
<attribute name="fullname" />
<attribute name="companyname" />
<attribute name="telephone1" />
<attribute name="leadid" />
<order attribute="fullname" descending="false" />
<filter type="and">
<condition attribute="new_campaignid" operator="eq" uiname="Test Campaign" uitype="campaign" value="{F7038DE4-B5A5-E211-8417-000C29E20CBC}" />
</filter>
</entity>
</fetch>
after create the dataset, I attached a screenshot of BIDS

Related

CRM Data Migration using Azure Data Factory

Am trying to migrate data from CRM online to Data Lake.
within Copy Activity of ADF, am using FetchXML to read data from CRM (CDM)
FetchXML:
<fetch>
<entity name="cdm_location">
<attribute name="cdm_gisid" />
<attribute name="cdm_locationid" />
<attribute name="cdm_locationtype" />
<attribute name="cdm_name" />
</entity>
</fetch>
Issue is ADF looks and the Sample dataset of above source query and determines the columns to be extracted. In my case column cdm_gisid within the sample dataset is NULL and hence this column is being ignored by ADF.
Is there a way in FetchXML saying if column is null replace with 'Default Value' so that ADF can see the column in the Sample Dataset.
[Or] is there better way in ADF to pull data from CDM, bringing every column irrespective if its null or not null.
You just need to use a column map which can be defined in the Mapping tab of your copy activity. This is a known issue and is recommend in the ADF/D365 documentation.
See the Important note in the following link.
https://learn.microsoft.com/en-us/azure/data-factory/connector-dynamics-crm-office-365#dynamics-as-a-source-type

Azure Devops - hosted XML: Conditional based Rules

we are using azure devops hosted xml process.
i am trying to set Field A as required when Field B equals to Field C but the comparison do not work with i compare two reference fields.
if i compare a reference field to a specific value it works, but i need to compare 2 fields.
This is the comparison (G.CR and G.FixFor both equal 815)
<FIELD refname="G.BugReason">
<WHEN field="G.CR" value="G.FixFor">
<REQUIRED />
</WHEN>
</FIELD>
both of the fields are defined as strings.
it does work when i do the following comparison (when G.CR equals 815):
<FIELD refname="G.BugReason">
<WHEN field="G.CR" value="815">
<REQUIRED />
</WHEN>
</FIELD>
please help.
thanks.
Guy.
The scenario you ask about isn't supported.
You can define conditions that are based on what value is assigned to
a specific field or whether a user modifies a specific field.
According to our official doc -- Assign conditional-based values and rules. It's not able to directly compare two field as a conditional-based rules.
You could create a related user voice and vote up in our feature request page from Developer Community site. Our PM will kindly review your suggestion.

Querying Jobs for a Customer

I'm trying to query Jobs for a specific Customer, but am running into a little issue. It appears that the ParentRef is not queryable:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-02-19T10:20:31.635-08:00">
<Fault type="ValidationFault">
<Error code="4001">
<Message>Invalid query</Message>
<Detail>QueryValidationError: property 'ParentRef' is not queryable</Detail>
</Error>
</Fault>
</IntuitResponse>
However, that's the only thing I can think of to limit the query on the server-side. In the old world, we submitted a Filter of CustomerId :EQUALS: #{id} to the Jobs API, but now the Customer/Job APIs have been combined. My v3 query is SELECT * FROM Customer WHERE Job = true AND ParentRef = '#{id}' which seems like a reasonable thing to do.
Am I missing something? Could you allow us to query on ParentRef?
Something like this works OK:
SELECT * FROM Customer WHERE FullyQualifiedName LIKE 'Your Customer Name:%'
the above works if you only have one level. Try a cast:
if (null != cust.ParentRef && ((ReferenceType)cust.ParentRef).Value == c.Id)
Then if you were building a treeview for instance just wrap it in a recursive method.

how could I prevent Mybatis from overwriting the already generated mapper files in DAO?

Since the requirements are changing,I need to update the DAO's mapper files from time to time using Mybatis. And here is the problem that I got: we've already generated a set of mapper xml files and additionally,we defined our own specific elements in the mapper file.
<select id="selectTop20PlayerOfClassicCard" resultMap="CollectionRankingMap">
SELECT playerid,count(cardid) from re_player_card where type in (0,1) GROUP
BY playerid ORDER BY COUNT(*) DESC limit 20;
</select>
<select id="selectTop20PlayerOfSpecialCard" resultMap="CollectionRankingMap">
SELECT playerid,count(cardid) from re_player_card where type=2 GROUP BY
playerid ORDER BY COUNT(*) DESC limit 20;
</select>
<resultMap id="CollectionRankingMap" type="dymaic.RePlayerCardRanking">
<!-- manually generated -->
<result column="playerid" jdbcType="INTEGER" property="playerid" />
<result column="count(cardid)" jdbcType="INTEGER" property="count" />
</resultMap>
<select id="getCardIdByPlayerId" parameterType="int" resultType="int">
select
re_player_card.cardid
from re_player_card
where playerid = #{playerid}
</select>
The 3 select statements and the resultmap are defined by ourselves. Now I'm going to regenerate the mapper files again.But I don't want these statement blocks to be overwriten. I need to keep them in the mapper file while changing the rest with Mybatis.
I'm using the Mybatis generator eclipse plugin. So is there any way to make it? I'd appreciate for you guys' help.
I don't think MyBatis Generator Tool is capable of updating the partial content of the generated files.
If you are using MyBatis Generator Maven plugin you can add the following property in pom.xml to tell not to override the existing files and generate the files with another name.
<mybatis.generator.overwrite>false</mybatis.generator.overwrite>
PS: My above assumption is wrong.
From MyBatis documentation:
MyBatis generator is designed to run well in an iterative development environment, and can be included as an Ant task, or a Maven plugin, in a continuous build environment. Important things to note when running MBG iteratively include:
MBG will automatically merge XML files if there is an existing file
with the same name as the newly generated XML file. MBG will not
overwrite any custom changes you make to the XML files it generates.
You can run it over and over again without fear of losing custom
changes to you XML.
MBG will replace any XML elements that were
generated in a previous run. MBG will not merge Java files, it can
either overwrite existing files or save newly generated files with a
different unique name. If you make changes to the generated Java files
and run MBG iteratively you will have to merge the changes by hand.
When run as an Eclipse plugin, then MBG can automatically merge Java
files.
Put your changes into another mapper XML file
Take the existing file copy, e.g. MyMapperBits.xml and I choose to change the namespace ..."http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="MyMapperBitsMapperNameSpace">
Add the MyMapperBits.xml to the references in your main mybatis configuration file. In this example the package name items also contain various XML mappers, that I have configured mybatis generator to create.
<mappers>
<mapper resource="com/example/extended/xmlmapper/MyMapperBits.xml" />
<package name="com.exmaple.generated.xmlmapper.input_output"/>
<package name="com.exmaple.generated.xmlmapper.pg_schema_1"/>
<package name="com.exmaple.generated.xmlmapper.pg_schema_2"/>
</mappers>
You then can access the "SQL" with MyMapperBits.xml by accessing it via the namespace defined in the file
sqlSession . selectList(
"MyMapperBitsMapperNameSpace.selectTop20PlayerOfClassicCard" ) ;

Accessing metadata in Fetch-based reports

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.