Bryan - Gendev
Programmer
In my report I want to print "No details in Field'" when field empty in underlying table.
Where would I place the Alternate text please?
is it an iif empty(fieldname,data,alttext) somewhere?
Thanks
GenDev
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
iif (empty(edate),iif!(empty(srtdate),'Sort '+srtdate,edate))
* Preparation: create the cursor and add a few rows
CREATE CURSOR aa (nId I AUTOINC,edate D,srtdate D)
INSERT INTO aa (edate,srtdate) VALUES ({},{})
INSERT INTO aa (edate,srtdate) VALUES ({},DATE(2010,01,31))
INSERT INTO aa (edate,srtdate) VALUES (DATE(2011,02,28),{})
INSERT INTO aa (edate,srtdate) VALUES (DATE(2012,03,31),DATE(2013,04,30))
* Preparation: two dynamics conditions: first when both edate and srtdate are empty, second when only edate is empty
LOCAL lcStyle
TEXT TO m.lcStyle NOSHOW
<VFPData>
<reportdata name="Microsoft.VFP.Reporting.Builder.EvaluateContents" type="R" script="""" execute="empty_both" execwhen="empty(edate) and empty(srtdate)" class="" classlib="" declass="" declasslib="" penrgb="-1" fillrgb="-1" pena="255" filla="0" fname="Courier New" fsize="10" fstyle="0"/>
<reportdata name="Microsoft.VFP.Reporting.Builder.EvaluateContents" type="R" script="'Sort '+ TRANSFORM(srtdate)" execute="empty_edate" execwhen="empty(edate)" class="" classlib="" declass="" declasslib="" penrgb="-1" fillrgb="-1" pena="255" filla="0" fname="Courier New" fsize="10" fstyle="0"/>
</VFPData>
ENDTEXT
* Create and change the report
SET REPORTBEHAVIOR 90
CREATE REPORT aa FROM aa && create the report
SELECT 0
USE aa.frx EXCLUSIVE && change the report
DELETE FOR expr="srtdate" OR expr='"Srtdate"' && delete the label and field for srtdate
LOCATE FOR expr="nid"
replace stretch WITH .F. && uncheck stretch with overflow for the field nid
LOCATE FOR expr="edate"
replace width WITH 22300,stretch WITH .F. && uncheck stretch with overflow for the field edate and increase the width
replace style WITH m.lcStyle && add the dynamcis conditions
PACK
USE && end report alteration
SELECT aa
* Preview the results
REPORT FORM aa prev
MODIFY REPORT aa && double click the edate field and check the dynamics tab
* Preparation: create the cursor and add a few rows
CREATE CURSOR aa (nId I AUTOINC,edate D,srtdate D)
INSERT INTO aa (edate,srtdate) VALUES ({},{})
INSERT INTO aa (edate,srtdate) VALUES ({},DATE(2010,01,31))
INSERT INTO aa (edate,srtdate) VALUES (DATE(2011,02,28),{})
INSERT INTO aa (edate,srtdate) VALUES (DATE(2012,03,31),DATE(2013,04,30))
* Preparation: two dynamics conditions: first when both edate and srtdate are empty, second when only edate is empty
LOCAL lcStyle
TEXT TO m.lcStyle NOSHOW
<VFPData>
<reportdata name="Microsoft.VFP.Reporting.Builder.EvaluateContents" type="R" script="''" execute="empty_both" execwhen="empty(edate) and empty(srtdate)" class="" classlib="" declass="" declasslib="" penrgb="-1" fillrgb="-1" pena="255" filla="0" fname="Courier New" fsize="10" fstyle="0"/>
<reportdata name="Microsoft.VFP.Reporting.Builder.EvaluateContents" type="R" script="'Sort '+ TRANSFORM(srtdate)" execute="empty_edate" execwhen="empty(edate)" class="" classlib="" declass="" declasslib="" penrgb="-1" fillrgb="-1" pena="255" filla="0" fname="Courier New" fsize="10" fstyle="0"/>
</VFPData>
ENDTEXT
* Create and change the report
SET REPORTBEHAVIOR 90
CREATE REPORT aa FROM aa && create the report
SELECT 0
USE aa.frx EXCLUSIVE && change the report
DELETE FOR expr="srtdate" OR expr='"Srtdate"' && delete the label and field for srtdate
LOCATE FOR expr="nid"
replace stretch WITH .F. && uncheck stretch with overflow for the field nid
LOCATE FOR expr="edate"
replace width WITH 22300,stretch WITH .F. && uncheck stretch with overflow for the field edate and increase the width
replace style WITH m.lcStyle && add the dynamcis conditions
PACK
USE && end report alteration
SELECT aa
* Preview the results
REPORT FORM aa prev
MODIFY REPORT aa && double click the edate field and check the dynamics tab
TEXT TO m.lcStyle NOSHOW
<VFPData>
<reportdata name="Microsoft.VFP.Reporting.Builder.EvaluateContents" type="R" script=""""....