문제

In a traditional notes form, I want to compute an image dynamically. Image is in another database's image resource in the same server.

I have tried using pass thru HTML by computing the URL in computed text. Its working fine in web. But I need to show the form in Notes Client. I am using the client version 8.5.2.

In computing URL I have tried using notes:// instead of http://. Still no luck. If anybody help me to find out.

Thanks in advance.

도움이 되었습니까?

해결책

It appears the computed image resource doesn't like implied text construction, I tried to do exactly as you building the image string and it kept failing until I did this:

@Text(@GetField("from") + ".jpg")

I used a combo box "from" to test with "refresh on keyword change" to simulate a new value. The images changed beautifully and the resource was selected from a different database.

One thing to watch for, that I was unaware of, is if you create an image resource and import a .bmp (bitmap) image, it's changed to an .jpg. This could mess you up by trying to reference a non existing image.

In short, a computed image resource from a different database will work.

다른 팁

While inserting image resource you can select the database from which the image needs to be loaded. So when you go to "Create > Image Resource" you can select "Database" field and then the images in that database.

All you need to do is insert an image resource. Place your cursor on the form where you want the dynamic picture, right mouse click and select "insert resource". Once the "Insert Recource" dialog displays select the database where the image resources are stored and the select the "Images" Resource type. You will have to select an image, probably make it your default image and click "OK".

Next, click on the image to give it focus and then either do an "alt + Enter" or right click and select "Picture Properties". When the picture properties display you'll see at the far right of the "Source" field two icons, select the second "@" for the formula window, this is where the magic is done. You'll see the current image name is already there. All you do now is create your @If statements to change the image name, no paths just the image name, the resource is already tied to the database where your images are stored. This has been long but actually implementing is quick and simple. enjoy:-)

Karthick,

I'm not sure if this is your issue but remember the order of how your form is processed, left to right and top down. If the field with your empcode is positiond after the image resource, the formula won't see the field value, unless you do a refresh. I used a field that contained the value to check to switch my images and that worked. Have you tried @GetField("the field name") to return the value?

You can not do it in direct way. You can neither compute the database nor pass the other db's image url. When inserting resource, it will ask for database name. if you choose the name as "a". Then the image resource will adopt to the database what you have chosen. It will take the images from the db "a". It will not take the image from current DB. So you just pass the image file name simply.

Use formula like this.,

@If(@GetField("pic")="1";"spinning earth.gif";@GetField("pic") = "3";"logo.jpg";"attach2.jpg")

The mentioned three picture is coming from different database but same server. If you want to fetch the image from current db then use another image resource. Make hide when. squeeze your brian.

The computed image resource as described in the other solutions will for sure work. The only "problem" is, that the designer wants to get a text pointing to a valid file when saving the form. Otherwise it will render the image unusable.

Knowing that and knowing, that field- values are considered empty in the designer client, you have to "wrap" your result in an if- clause, or break out of computation, if the needed field is empty. Your first line could look like:

@If( FieldWithImageName = ""; @Return( "myfallbackimage.jpg" ); "" );

After that you do your computation. designer will fallback to the fallback- image, and the client will compute the image based on your formula, if the field that you refer to is above the image (you know: left to right, top to bottom computation of forms)

Another thing to notice: in earlier versions of Lotus Notes the image just scaled to its own 100% size, when you seleced 100% in the image properties. But in 7 (iirc) this changed, and all images are displayed with the number of pixels the image in designer was stored. If your fallback- image is 100x100 pixels, then every image will be squeezed or stretched to that extends. So better be sure, all images have the same size.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top