Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Chekbox image in Report
Message
From
25/06/2003 23:02:19
 
 
To
25/06/2003 22:10:41
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00804074
Message ID:
00804084
Views:
33
João,

Hilmar is right, it can be done completely without using a general field. For some mysterious reason the report generator is not happy using an iif() statement with 2 hardcoded file names, so here is a workaround.

In the report generator, drop a picture control on the form. In the picture from file portion of the dialog, put:
iif(field1='0', blankBox, checkedBox)
Before running the report, assign the images to blankBox and checkedBox variables, for example:
blankBox = "c:\data\images\blankBox.jpg"
checkedBox = "c:\data\images\checkBox.jpg"
report form ....   && run your report
You can assign the two variables in the command window while designing the report, so you can preview the design.

Also, you can use the other idea Hilmar mentioned...you can add another field to your report cursor:
select *, iif(field1='0', "c:\data\images\blankBox.jpg", "c:\data\images\checkBox.jpg") as checkBox ;
    from table1 ... ;  && where clause, etc...
    into cursor reportCursor
If you go this route, you only have to put "checkBox" (without the quote marks) in the "Picture from file" dialog in the report designer. Also, if you go this route, you will probably need the file names to be the same length in the SELECT statement, or one of them may get truncated in certain situations. You can make them the same length by padding the right side of the shorter file name with spaces.

>Hi all,
>
>I have a field that have value '0' or '1', what i want to do in report is, if '0' a blank checkbox image, if '1' a cross checkbox image.
>
>Thank's,
>
>João Batista
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform