Custom Query report problem

Friday, July 17, 2015
Avatar
I can't use select inside select in my query!

As an example:
select 
R.name as NAME, 
R.DESCRIPTION,     
    (select E.name 
    from SpiraTestEntities.R_CustomListValues as E 
    join SpiraTestEntities.R_Incidents as A on A.PROJECT_ID = E.PROJECT_ID 
    where A.CUST_03 = cast(E.CUSTOM_PROPERTY_VALUE_ID as string) and E.CUSTOM_PROPERTY_LIST_ID = 11) as AREA 
from SpiraTestEntities.R_Incidents as R 
where R.PROJECT_GROUP_ID = ${ProjectGroupId}

This query gives AREA as System.Data.Query.ResultAssembly.BridgeDataReader and all other fields as they should.
Both selects work when not combined. 
I have to make a query with 2 of these selects inside a select to get values in place of IDs. 

How is one suposed to get actual values into a report when using multiple custom fields?
3 Replies
Tuesday, July 21, 2015
Avatar
re: Teemu Friday, July 17, 2015
Hi Teemu

I would use a join rather than sub-select as illustrated here: https://www.inflectra.com/Support/KnowledgeBase/KB74.aspx

Regards

Adam
Wednesday, July 22, 2015
Avatar
re: inflectra.david Tuesday, July 21, 2015
Thanks!

I got it working with join.
Monday, July 27, 2015
Avatar
re: Teemu Wednesday, July 22, 2015
Hi!

I can't get project name in top of my report to change to project group name.
Is that possible?

I tryed to edit Standard Section like this: 

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:template match="/ProjectData/Project">
<div class="Title1">Project Group <xsl:value-of select="ProjectGroupId"/>: <xsl:value-of select="Name"/></div>
<p>
<xsl:value-of select="Description" disable-output-escaping="yes"/>
</p>
</xsl:template>
</xsl:stylesheet>

but I don't know where this select is so it could be edited. Is there something I should change in 'match="/ProjectData/Project"'?

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Friday, July 17, 2015
  • Last Reply: Monday, July 27, 2015
  • Replies: 3
  • Views: 6790