Link to home
Start Free TrialLog in
Avatar of OSXFreak
OSXFreakFlag for United States of America

asked on

Filemaker Pro Web Sharing issue

I've set up my FMP database... Imported in my data and one of the things that gets imported in is raw html code that is sitting in my SQL servers database.

So I created a Web Viewer in Filemaker Pro and then set it as web address of...
 "data:text/html," & Inventory::Item Text

The data looks great in the Filemaker Pro program but when I open it in FireFox the web viewer just has a smaller grey outlined box.
So I figured maybe something with Firefox, so I tried for the first time to connect up to my web shared site using IE8 and I got page not found.. So I went to the local machine and tried IE and same thing, but it comes up just fine in FireFox..
Any ideas?
I also tried to find the webserver files but no luck. I do however have IIS installed on my machine running another site. But I chose a separate port for the FMP site

Thanks

Chip
Avatar of OSXFreak
OSXFreak
Flag of United States of America image

ASKER

OK I kind of know what was happening I was missing the http:// at the begining..
But now it lets me log in tot he website, but when it pops up, it starts to load, but then jumps to the frame and this shows in address bar..
data:text/html,

Any info on this part?

Chip
Avatar of ThomDroz
ThomDroz

Hi Chip

I am a little confused by your example but... as your text string ("data:text/html,") is what is show
have you seen the results if you remove that??

Hope that helps

tom
I have some web viewers that display google charts which work in all browsers (Mac & PC).  The URL components I use in the 'Set Web Viewer' script step are:

"data:text/html," & $reportcontent

The variable $reportcontent is put together earlier in the script and contains the following code:

"<html><meta http-equiv=" & Quote("Content-Type") & " content=" & Quote("text/html; charset=iso-8859-1") & "><style type=" & Quote("text/css") & ">
<!--
h1 {
      font-family: Verdana;
      font-size: 12pt;
      font-weight: normal;
      font-variant: normal;
}


p {
      font-family: Verdana;
      font-size: 10pt;
      font-weight: normal;
      font-variant: normal;

}


.footer {
         
         font-family: Verdana;
      font-size: x-small;
      font-weight: normal;
      font-variant: normal;
         text-align: right;
}


#allcontent {

width:700px;
margin-left:auto;
margin-right:auto;
      
            
}
-->
</style>

<body><div id=" & Quote ( "allcontent" ) & ">" & 

Global::g_ReportName & "<hr />" &


Case (
Get ( ScriptParameter ) = "bar" ; $chart_bar  ;
Get ( ScriptParameter ) = "pie" ; $chart_pie  ;
 ) &

"<br /><br /><hr /><br /><p class=" & Quote ( "footer" ) & ">" & Get ( CurrentTimeStamp ) & "</p></div></body></html>"
OK so a guess I was missing some KEY information :) oops..

I Imported the database from our SQL database for our eCommerce site. The programmers only give us select area's where we can write our own html coding,  like at the bottom of an items detail page. The name of the Column in SQL is called ItemText.

So when I imported that info in to the FMP database, and I looked at it in the FMP program it was showing my raw HTML code in that Field.

So a little googling led me to learn how to add in a website or raw html code using web viewer..
This is the code that I used, so it's puling the raw HTML code from the Item Text column in the FMP "Inventory" DB

So when I look at the Filemaker program Layout for the Form everything looks good.

BUT when I open it in FireFox (Windows) it shows it as a larger grey out lined box( the box of the web viewer),  and then a smaller grey outlined box on the inside of the web viewer box.

So I decided to try to see what happens when I use IE8 and the results are this..

I log in, it shows me a Bar (part of my layout), but then looks like it tries to load a separate page. I think it's trying to open the Web Viewer in the MAIN window rather then where I set it to open up at..

This is the CODE used in the Web viewer program..
"data:text/html," & Inventory::Item Text

In the address bar the only thing that shows when it looks like it's trying to load the web viewer is the first part.. "data:text/html,"

Thanks for helping me with this..

Chip
Try putting the contents of Inventory::Item Text into a variable (let's say $itemtext) and include that in the URL, rather than the field.  Not sure if this will make the difference.

Now, when you say you "open it in Firefox", what exactly do you mean?
Ok will try that.. now to learn how to add it to a variable LOL I'm  Such a n00b lol

Thanks
As for firefox, let me try the variable part first, if it fails, I'll send you a link so you can see what it's doing :)

Chip
Are you setting the web viewer with a script?  If not, create a script with the following steps:

set variable
  - double click the script step and give the variable a name starting with a $ sign, like:  $itemtext and in the empty field underneath
    select your field, or just free-type in "Inventory::Item Text"

set web viewer
  - in object name, enter something like "mywebviewer" (without the quote marks)
  - select URL and set it with "data:text/html," & $itemtext

That's all for the script - now go to your layout, enter layout mode and in the View menu, make sure there is a tick next to Object Info (if there is a small window will be showing with dimensions and some anchors on it).  Click your webview and in the Object Info window, enter "mywebviewer" (without the quotes) in the Object name field.

Now go into browse mode and run your script - what do you get?
OK sorry to be difficult..  So do I create a NEW SCRIPT? By clicking on SCRIPT>Manage Scripts at the top of the screen.
Then make a New Script.. Name it $ItemText
then on the left I select Perform Script and this then puts Perform Script {<unknonw>]  

If I select specify it looks for a script.. I vicious circle I fear.. lol lol

Ok I guess I need to know what you mean by double click script. I'm using FileMaker Pro 11

Thanks and Sorry for being such a n00b :)
I mean double click the script step.  You've got the steps right to create a new script; instead of calling the script $itemtext, call it My Web Viewer Script.  Now you should have a big white open box with a list of "script steps" on the left hand side.  In that list, find the 'Set Variable' script step (it's quite near the top, about an inch or so down) and the Set Web Viewer script step (it's very near the bottom of the list).  

Double click each script step to transport them into the big white empty box.  When they are in the white box, double click each one to set their parameters (follow the steps in my earlier post).  When you're done, close the script maker window (there's no close button, just close the window as you normally would) and opt to save the script.

To run the script, make sure you're on the layout that displays the web viewer and then select your script which now appears in the Scripts menu at the top of the screen.
OK so close I can taste it..

see the attached images.. You will see that I have scripts set, but not sure what I'm missing on the webviewer part as nothign is now showing..

Thanks

Chip


scripts-settings.jpg
webviwer-info.jpg
Did you do the bit where you go into Layout mode and make sure Object Info is ticked in the View menu, then click the webviewer and enter the exact same object name in the Object Info box as you put in the Set Web Viewer script step?
BTW, I'm still using v10, so the Object Info bit has probably been replaced by the new Object Inspector panel.  Find a bit on there where you can give an object a name (you have to have the object selected though - in this case, make sure you've clicked the web viewer before you enter it's name)
OK Tocacar,
I did a help and found that in FMP11 you have to do the below..

Naming objects
To name an object:
1.  In Layout mode, select the object or grouped object that you want to name.

For more information, see Selecting objects.
2.  Click Inspector  in the layout bar, then click Position.

3.  In the Position area, type a value for Name.

4.  Press Enter or Tab, or click outside the Inspector to apply the changes.

So I did this, and named it MyWebViewer

Closed out and came back in and selected the web viewer window and it still showed the name, so then I went back in to the WebViewer and removed the "data:text/html," & $ItemText from the web set up section of it.. I figured that needed to be done so that the script took over for that field since i named it..
But still have nothing showing up in Firefox or IE, although IE is no longer jumping to blank web page :).. when using Instant Web Publishing...
Strangely, in FMP program when in the actual program, I don't see any data in the webview box UNTIL I click on that box, then it pops in the html code.

But I think I have it set right like you suggested.. let me know if screen shots will help or even access to the website.
I'm going to be busy for the next couple of hours - can we pick this up again tomorrow (I'm on UK time)?  If anyone else wants to jump in and help you in the meantime, that would be great.  

I'll post again tomorrow.
OK Perfect thanks for all your help I'll tinker and if I figure out what I'm doing wrong, I'll post what my findings where..

I truly appreciate it..

Chip
Hi Chip

I'm back online.  Access to your website would be good, if that's possible.  If you're able to provide a sample of your file too, that would also be good.

Before you do, add another script step to the end of your script (after the set web viewer step) called 'Commit Record' and give it another whirl...

Tocacar,
I tried the Commit Record and still nada. I assume I DO NOT put a check in the script step options..

One other thing I noticed was that if I'm in the FMP program, and click on the arrow to go to my different records, when I get to the record that should show the html code it doesn't show it UNTIL I click on the Web Viewer Box.. OR Select Scripts>MyWebScript from the menu.

As for the site it's not showing up in either IE or FireFox

How can I send you the IP info for my FMP site so you can see what I have happening?

Thanks

Chip
If your site is available externally (i.e., outside your company firewall), just send me the link you're accessing it with.  If it isn't external, post a sample of your file and I'll put it on my server and have a look.

Re; the commit records step, click the 'Perform without dialog' just to see if it makes a difference ("with dialog" is not compatible with IWP so it should default to no dialog anyway, but it's worth a try).

It will be much easier to help you with a sample file, but I understand you might prefer not to post one.  I'm going offline again now for today (it's the time difference!), but if you do post a file I should have a reply ready for you when you log back in tomorrow.
How do I get you a file.. Not worried about the file just part numbers and descriptions..
Just logged in to see if you posted the sample file....

All you need to do is click the 'File' link (next to 'Code' and 'Image') which is underneath the box you type in to post a response and upload it.  Just upload a copy of the real file with all data removed except for a few dummy records showing data in the relevant fields (this way you protect your 'real' data).
LOL ok that part I get.... The question I have is HOW do I get the FILE from FileMakerPro? lol lol lol

Thanks

Chip
Tocacar

Figured it out. But could not figure out how to delete ALL data.. anyhow if you go to the record 6,7,8,9 or the one with product number of CL138KD you will see the Info in the Extended Description Currently in eCatalog. This is the HTML code..

IN my version of FMP the only way it POPs in is if I click on the webviewer, or do a run scripts.

Thanks

Chip
ContentProject-Copy.fp7
on an unrelated topic, anyone ever hear of using FMP to help create HTML sites almost as a template.. I have a specified area at the bottom of our eCommerce website that allows us to drop any HTML code.

Just asking as I was originally looking to use Contribute and Dreamweaver ( I set up Template, Designers drop in pics and details in product..

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Tocacar
Tocacar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for all your hard work... I will go purchase that book and if someone gives me any tips that work even If not from this site I will post here

Also thanks for the HTML info. Thinking were better off using contribute and dreamweaver.

One final Q..  In the file you will see that I have a picture box. In my SQL server it uses a relative link /picturecatrgory/123456.jpg

Anyway I can force it to grab the Uniate direct from webserver by adding in c:/directory1/ so it adds that to begining of the imported data and alway pulls latest picture. And any newly added images

Thanks
Chip
Hi Chip
Thanks for the points.  Re; your final question, I didn't spot the actual question - can you clarify please and I'll see if I can help.

Tocacar,

If you still have my sample DB, you will see the Picture box is pulling from the database PictureCategorirs/123456.jpg with the 123 changing for every part if unique.

In our SQl database, it has this pointing to a root folder for the website.

So I guess what I need is to have the data pulled from our SQL database which will pull the file directory of /picturecategories/123456.jpg, but I truly need it to point to c://Folder1/Folder2/picturecategories/123456.jpg

Is there a way to PULL that data from the SQL database and have it pull the picture rather then pull the actual text?

Thanks
Chip