parameter from main zen sql query

47 views
Skip to first unread message

monty

unread,
Dec 4, 2015, 3:03:08 PM12/4/15
to InterSystems: Zen Community
i am doing something like this (from documention)
<table
sql="SELECT NAME,AGE,FAVORITECOLORS FROM SAMPLE.PERSON WHERE NAME %STARTSWITH ?"
selectmode="2" orient="col" class="table4" >
<parameter value="B"/>
<item fieldname="NAME" suppressDuplicates="true" width="1.5in">
<caption value="Name"/>


I want to have the parameter to be the id from the main sql query. is that possible?

XData ReportDefinition [ XMLNamespace = "http://www.intersystems.com/zen/report/definition]
{
<report xmlns="http://www.intersystems.com/zen/report/definition"
 name="FaceSheet"
 sql="
  select id,
  LastName,
  FirstName,
  MiddleName,
  EvalPlace,
  ReferralDate,
  MRN,
  Race->race Race,
  DOB,
  SSN,
  County->name County,
  Court->crtname Court
  from SQLUSER.FaceSheet
  where facesheetid='5510tr'
  ">
  <group name="Referral">
<attribute field="id" name="id" />
<attribute field="EvalPlace" name="EvalPlace" />
<attribute field="ReferralDate" name="ReferralDate" />
<attribute field="MRN" name="MRN" />
<attribute field="County" name="County" />
<attribute field="Court" name="Court" />

  </group>
<group name="Name">
<attribute field="LastName" name="LastName" />
<attribute field="FirstName" name="FirstName" />
<attribute field="MiddleName" name="MiddleName" />
<attribute field="Race" name="Race" />
<attribute field="DOB" name="DOB" />
<attribute field="SSN" name="SSN" />
</group>

<!-- add definition of the report here. -->
</report>
}

Vlado

unread,
Dec 6, 2015, 12:36:41 PM12/6/15
to InterSystems: Zen Community
Hi Monty
======================================================================================
Property p1 As %ZEN.Datatype.string(ZENURL = "ID");

<
group name='Kadri' sql="SELECT * FROM Kadri_Data.Kadri
 WHERE (ID = ?) OR (? IS NULL) Order By ID">

 <parameter expression='..p1'/>
 <parameter expression='..p1'/>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ClientMethod runReport() [ Language = javascript ]
{
var id zen('source').getModelId();

if ('' == id) {alert('Вие искате да разпечатате,'+'\n'+' но нищо не е избрано!'+'\n'+'Моля изберете ред в таблицата!');}
else {window.location='Kadri.Reports.KadriReport.cls'+'?ID='+id}
}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

======================================================================================
**Владо

Montes, Richard (DSHS/WSH)

unread,
Dec 7, 2015, 11:05:44 AM12/7/15
to intersys...@googlegroups.com

Cool Thanks Vlado that did the trick

 

Richard Montes, ITS5

Western State Hospital

253.761.3306

Richard...@dshs.wa.gov

--
You received this message because you are subscribed to the Google Groups "InterSystems: Zen Community" group.
To post to this group, send email to InterSys...@googlegroups.com
To unsubscribe from this group, send email to InterSystems-Z...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/InterSystems-ZEN?hl=en
Zen Community Terms and Conditions: http://groups.google.com/group/InterSystems-ZEN/web/community-terms-and-conditions
---
You received this message because you are subscribed to the Google Groups "InterSystems: Zen Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-z...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages