Quantcast
Channel: Home of ActiveVFP - Foxpro on the World Wide Web
Viewing all 1109 articles
Browse latest View live

New Post: ActiveVFP vs. FoxWeb

$
0
0
FoxWeb doesn't look like it offers much to start off with. ActiveVFP has lots of demos you can experiment with online right away. I haven't even applied all of the demos yet.

I'm not a foxpro or web developer at all and I was able to put together a fairly robust front end for our ERP system part-time over the past year and a half. It's not complete but it's mostly there, and as I said there are features I am still working on or will add in the near future.

I should point out that some of the demos for ActiveVFP are outdated but I have updated them for my use. Specifically the PDF generator and the email sender do not work as they are, but I was able to get them both working with some help and testing.

New Post: How to print directly to the printer without pdf

$
0
0
Where is this extension pack?

I'm assuming this would print using a driver on the server to a printer on the server's local network?

I sort of like the PDF generator because otherwise how can a remote client see a preview?

New Post: PDF reports in SQL server (client server) environment

$
0
0
It's been a while since I worked on this due to other business, but I have finished getting PDFfun to work. I want to post the changes to a new thread though.

New Post: Improvements to PDFrun PDF generator.

$
0
0
Overall I've been very impressed with ActiveVFP. There are a couple of features in the currently available demo which did not work for me. One was the email sender, which I was able to get working using other code from the web. The other is the PDF generator.

The PDF generator (PDFRUN) as it is does work, as long as your form only accesses a single table and does not use any outside variables.

Since PDFRUN is an executable running in its own memory space, it can't see what tables you have open or what variables you have, so you need a way to pass this information over to it somehow. Not only that, if your form calls functions, you need a way to make those functions available to PDFRUN also. And furthermore, my existing database has a method of expanding the reach of the PDF beyond the scope the application extends to it with a program file.

In order to deal with these three issues I made three changes to the source code of PDFRUN, for which I needed to acquire a copy of VFP to recompile it and test/debug it.

I worked on ActiveVFP for over a year without even a copy of VFP so that should tell you how good ActiveVFP really is. This is the only thing I'm sure I needed it for.

Ok, so what changes did I make?

First of all, I had to understand PDFRUN, and during that process I ripped out a lot of unnecessary code and reorganized it and renamed the functions. For example, there is a useless function to install PDF reader. Nevermind that this is running on the web server.

I also use the error string for logging, so I could see ALL the errors. As it is it only reports the LAST error, so it took a while for me to trace my GhostScript issue and get its error code.

There are three new functions which must be called before the report form command:
  1. I require a separate PRG file containing functions which are called inside the form. I don't want to have to add them to the PDFRUN, it doesn't make sense to do so, especially because I don't know what forms might need in the future, and these functions may be used elsewhere in the front end application and may be in a shared PRG file.
cExtPrg="" &&filename of external PRG file containing support functions
function loadSupportFuncs()
if vartype(this.cExtPrg)!="C" or empty(this.cExtPrg)
    return .f.
endif
if !file(this.cExtPrg)
    return .f.
endif
set procedure to (this.cExtPrg) additive
endfunc && loadSupportFuncs
  1. I need to use EXECSCRIPT call inside PDFRUN to perform setup tasks for the form. I tried including functions in here, but it didn't work, so that's why #1 above was needed. EXECSCRIPT can load additional tables, set relations to them, and declare globals/publics before the report form is executed. This set up is constructed as a string and passed as a parameter to oPDF.
Note that I have renamed some of the parameters to be more explicit.

You have to change the path here because the default path is /WINDOWS/SYSTEM32/ which does not have write access. So I also pass my temp path, which I added to oProp in MAIN.PRG. Otherwise where the temp files are supposed to end up, not in system32 for sure.

I really appreciate and use try/catch whenever I run into trouble. String coded execscript is a perfect opportunity for trouble, especially syntax errors which are impossible to isolate.

cTempPath=""
cExecScript=""
function execScriptParam()
private lcReturn

if vartype(this.cTempPath)<>"C" or empty(this.cTempPath) or !directory(this.cTempPath)
    this.cTempPath=getenv("TEMP")
endif

cd (this.cTempPath)
this.cError=this.cError+"Temp folder: "+curdir()+"<br />"

if vartype(this.cExecScript)<>"C" or empty(this.cExecScript)
    this.cError=this.cError+"cExecScript is blank.<br />"
    return .f.
endif

this.cError=this.cError+"Trying to run cExecScript.<br />"
try
    lcReturn=execscript(this.cExecScript)
catch to oEx
    this.cError=this.cError+transform(oEx.ErrorNo)+": "+oEx.Message+" execscript<br />"
    this.lError=.t.
endtry
if vartype(lcReturn)=="C"
    **returns error message or whatever
    this.cError=this.cError+lcReturn+" in cExecScript<br />"
endif
if this.lError
    return .f.
endif
return .t.
endfunc && execScriptParam

3. I haven't finished working on the third part as it is optional. It automatically loads a file with the same name as the form but ".ef" extension containing additional tables and relations if those tables and relations weren't supplied by the original calling application.

The reason I need to do this is because my original application front end is still in use and I can't change it or block people from using it.

Because these files were made for a desktop front end, the .ef file also contains closing code to release the extra tables, but my application doesn't need that because everything I assume is released once PDFRUN halts.

Or do we need to close tables and release all?

New Post: Email Sender

$
0
0
The currently available demo includes an email sender using CDO which hasn't been supported by MS for a long time and just doesn't work anymore.

I used the final code from this page and it works ok. The only thing I added was a check if create winsock fails.

http://fox.wikis.com/wc.dll?Wiki~SendSmtpEmail

New Post: Email Sender

$
0
0
I should point out that the above code which uses WINSOCK does not support SSL, but the email server I am using does not use SSL so it works for me.

I also tried using PowerShell/Windows Scripting Host (WSH). That also works and provides SSL if you need it. I tested it on GMAIL servers, but we have our own email server. It may not work on older Windows version though. My test system is Windows 10, but our server is actually an old machine so PowerShell does not work on it.

I can't seem to find where I got the source code from, but there is discussion about it here:

https://www.mail-archive.com/search?l=profox@leafe.com&q=subject:%22Re%5C%3A+Sending+SMTP+emails+from+VFP+using+PowerShell.%22&o=newest&f=1

New Post: Anyone using activeVFP 6 on a GoDaddy server running ASP.NET 4.0/4.5 ?

$
0
0
Looking to find out if anyone is being able to run activeVFP on a GoDaddy server running ASP.NET 4.0/4.5.

All the references I have read so far mention running activeVFP v5 under ASP.NET 1.1 in 'Full Trust' mode at GoDaddy. I haven't done either but want to find out...

Thanks!
From GoDaddy:

The default trust level on your account depends on the version of ASP.NET you are currently using (more info).

ASP.NET 1.1
If you are using ASP.NET 1.1 on your Windows shared hosting account, you have 'full trust' on the server.
ASP.NET 2.0/3.0/3.5
If you're using .NET runtime environment 2.0, you have 'medium trust' on the server.
ASP.NET 4.0/4.5
If you're using .NET runtime environment 4.0, you have 'web full trust' on the server.
When using ASP.NET 4.0/4.5 you must declare Full Trust in your Web.Config. You can add the following snippet of code to your Web.Config:

<configuration>
<system.web>
    <trust level="Full" />
</system.web>
</configuration>

F

New Post: Anyone using activeVFP 6 on a GoDaddy server running ASP.NET 4.0/4.5 ?

$
0
0
Happy to report it works as expected on a GoDaddy server running ASP.NET 4.0/4.5.!

New Post: How do I run the AciveVFP Demo in the the latest Godaddy environment.

$
0
0
How do I run the AciveVFP Demo in the the latest Godaddy environment.
The Demo works locally on my PC but not in the Godaddy environment.
According to the Godaddy Tecjh Support the shared environment does not recognize *.AVFP files.
The Godaddy shared environment is aldo running IIS 8.0 instead of 7.0.

New Post: Modern web\mobile development with ActiveVFP example!

$
0
0
Hi I used ActiveVFP EP and got error program too large how i can recompile withh added config.fpw to resolve this problem?

Created Unassigned: Why in the ActiveVFP-Main.prg will not recognize the Getwordnum() function? [43576]

$
0
0
Why in the ActiveVFP-Main.prg will not recognize the Getwordnum() function?
I am trying to separate the first name and the last name from the full name text box(lcName) i.e.
lcName=PROPER(GETWORDNUM(lcName,1))+' '+PROPER(GETWORDNUM(lcName,2))

New Post: AVFP, MVC, Controllers and missing file for layout

$
0
0
Same here... need copy of "sampleslayout.avfp".

New Post: GoDaddy 10 step and done!

$
0
0
Some time ago I ported my avfp from GoDaddy to BigRock - as I posted at the time, I had to persuade them to set Full Trust level, but then it worked fine.
More recently they stopped offering full trust on their Win8 servers but promised it when they migrated to Win 12.
After some discussion with their Support people they have now done this for a domain hosting I have with them.
BUT it is still throwing errors - see http://avfp.andyd.in/ (/default.avfp optional)
.... any ideas/ suggestions please - thanks - AndyD

New Post: GoDaddy 10 step and done!

$
0
0
please see my latest post online - AndyD

New Post: How do I create a Javascript function within the *.AVFP file?

$
0
0
How do I create a Javascript function within the *.AVFP file?
<!--The HTML/Javascript below works --><!doctype>
<html>
        <title>Alert</title>
        <body>
            <script  type="text/javascript">
                var lcName="Alert Test"
                 alert(lcName+" is working.")
            </script>
        </body>
    </html>

<!--The HTML/Javascript Function below does not work, But it does not work using the Javascript “Function” (although the simulair code above works) ...Why? --> <!DOCTYPE>
<html>
        <title>Alert</title>
        <body>
                <script TYPE="TEXT/JAVASCRIPT">
                    FullName("Function Test");
                    FUNCTION FullName(lcName)
                    {
                     alert(lcName+" is not working...Why?");
                    }
                </script>
        </body>
    </html>

New Post: How do I create a Javascript function within the *.AVFP file?

$
0
0
First your function needs to be triggered. Second javascript is case sensitive.
<html>
    <title>Alert</title>
    <body>
        <button onclick="FullName('XXX')">TEST</button>
            <script TYPE="TEXT/JAVASCRIPT">
                function FullName(lcName)
                {
                 alert(lcName +" is not working...Why?");
                }
            </script>
    </body>
</html>

New Post: ActiveVFP: Are there any example for data validation in the demo?

$
0
0
I have attempted to validate data input from the user by trying to use VFP function(i.e GetWordNum() or StrtoFile() )in the Main.prg but errored out on the particular Function line. What are the functions I can not use in the Main.prg?

New Post: ActiveVFP: How do I pass a foxpro variable into a Javascript variable i.e cName from the *.AVFP file?

$
0
0
ActiveVFP: How do I pass a foxpro variable into a Javascript variable i.e cName below?
<% cName='GauldinMaurice'
use member in 0
if SEEK(lcName,'Member','name')
cName=ALLTRIM(Member.Name)
%>
<script>
    alert(cName+" is a Member.");
</script>
<% else %>
<script>
    alert(cName+" is not a Member.");
</script>
<% endif %>

New Post: Are there any other resources (i.e. book,accessible documentation) other than this site for help with ActiveVFP?

$
0
0
Are there any other resources (i.e. book,accessible documentation) other than this site for help with ActiveVFP?

New Post: Are there any other resources (i.e. book,accessible documentation) other than this site for help with ActiveVFP?

$
0
0
This is the official site but look for entries in Foxite.com and others for feedback as well.
Viewing all 1109 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>