1 2 3 Previous Next 34 Replies Latest reply on Dec 14, 2011 11:58 AM by Fagreement

    Images with External Data Source

    Fagreement

      Title

      Images with External Data Source

      Post

      I have a FM application with SQL server as central database. Diffrent FM clients are conencted to this DB.

      when using External Data Source (SQL server and i USE odbc to connect FM to the database,) I cannot see in FM the fields created as Image in Sql Server, the reason is FM doesn't read the binary files from the external database.

       

      In fact in one of my layout I want to display in a portal a set of images (small images) and the idea is when the user click on a image the related image file will be opened. If I do it using FM database I have no pbm, but with SQL server DB I have an issue.

      Knowing that I don't want to create central FM database, as Workaround, how can I proceed?

      One idea is to store in SQL server field only the path of the images. But the issue is how in FM layout I can display the small images in the layout automatically when the layout opened?

      hope I was clear

      (it's urgent, thanks)

        • 1. Re: Images with External Data Source
          philmodjunk

          If you store the path in SQL server, You can use the path in either a calculation field that returns "Container" in a FileMaker table to display the image or you might be able to set up a web viewer to display the image. Since you specifically mention small images, I'd try the container field option first as I think it will work better.

          Your container calculation would need to take the path as stored in the SQL field and produce a path compatible with the user's platform and in a format that works within a container field. The path to the image file would need to be directly accessible to the user as well. This means that the image file would need to be in a shared directory and this directory or its containing volume would need to be mapped and mounted to your user's computer such that the file path to the image file is exactly the same as the file path stored in this field. (That might explain why you can't get the image fields to work--if they store a reference, it has to be in the correct format and with a valid path before Filemaker can make it work for you.)

          • 2. Re: Images with External Data Source
            Fagreement

            interesting but I didn't get your point 100%

            1. Insert a record: How can I do so the user can insert in the layout the image by Ref and store it as a path in the SQL field

            2. Read from the DB: I have the field in SQL where I store the path, how can I use the calculation field that returns "Container" in a FileMaker table to display the image (I never used the web viewer)

            thanks

            • 3. Re: Images with External Data Source
              philmodjunk

              Create a small test file with a container field named "Container".

              Create a calculation field named "ContainerText", define it to return text and enter the name of the first field, container as it's sole calculation term. Size this field several lines of text tall and place it next to the container field. Use Insert Picture to insert a "store a reference" picture file into the container field. Note the text displayed in the ContainerText field. If your calcualtion recreates the file path you see in ContainerText and you specify "container" as its return type, it will display the image just like the original container field.

              Thus, if you can set up a calculation that references the filepath in the SQL Server table, but reformats it as needed to produce the format you see in the containerText field, it should then display the image, provided your user has mounted/mapped the directory where the image file is stored with an identical file path to it.

              • 4. Re: Images with External Data Source
                Fagreement

                I created a field in my SQL DB : PhotoContainer, it's a text, I stored the full path of the image

                As you told me, I create in the same table but from FM side a field ContainerInFM, by calculation, type = container, right?

                what should i do next?

                • 5. Re: Images with External Data Source
                  philmodjunk

                  Do you have both mac and windows users?

                  Have you figured out the format the calculation container field needs to use to display the image?

                  Will each user have the same file path via a mounted volume to that image file?

                  • 6. Re: Images with External Data Source
                    Fagreement

                    only windows users

                    the calculation container should be displayed as image

                    the path is a full path, related to a fixed folder on the server, common to all users

                    • 7. Re: Images with External Data Source
                      philmodjunk

                      the path is a full path, related to a fixed folder on the server, common to all users

                      And is the folder identicall mapped and mounted on each user's computer? If you right click the folder and check properties to see its file path, does the file path exactly match that produced in this calculation?

                      • 8. Re: Images with External Data Source
                        Fagreement

                        the folder is identical to all users, same path

                        please how can i proceed? it's urgent

                        • 9. Re: Images with External Data Source
                          philmodjunk

                          does the file path exactly match that produced in this calculation?

                          • 10. Re: Images with External Data Source
                            Fagreement

                            I think there was a misunderstanding cause I didn't performed any modification, my original question was: using SQL (external DB) I want to display in a portal a set of images (small images) and  when the user click on a image the related image file will be opened. How can I proceed?

                            • 11. Re: Images with External Data Source
                              philmodjunk

                              And step one of that process is to display the images. Can you do that? Once you can get a single record to display the correct image, the rest becomes pretty easy to set up.

                              Either a calculation that returns "container" as it's type or a web viewer with the correct File type URL can display an image file's image, but both require a valid file path and your users must have access to that image file (The path must be valid and they must have at least read only access privileges to it.) before the image will be visible on their layout.

                              • 12. Re: Images with External Data Source
                                Fagreement

                                Please valdiate the steps:

                                1. In SQL: I create a Photo::ContainerJustForDisplay , type text, I insert the path "C:\Users\wisso\Links\Documents\CPEL-Archive\tabssearch"

                                2. In FM: I create Photo::ContainerInFMCalc, type calculation, calculation result = container (see attach)

                                if it'ok how i have to continue?

                                • 13. Re: Images with External Data Source
                                  philmodjunk

                                  C:\Users\wisso\Links\Documents\CPEL-Archive\tabssearch

                                  will not have quite the right format for your container field.

                                  Set up this expression for your container field:

                                  "IimageWin:/" & Substitute ( containerjustfordisplay ; "\\" ; "/" )

                                  \ is a special escape character that is used in text expressions so we have to use two of them \\ to get it to evaluate as a single \ in quotes.

                                  • 14. Re: Images with External Data Source
                                    Fagreement

                                    so here we go (find attach)

                                    i didn't get your point yet!

                                    what we are trying to do? ok i have a text field in SQL where i store the path. I have in FM calculation field of type container. what should I do, how is gonna work?

                                    1 2 3 Previous Next