This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
61
Web Server - Ask For Help / Re: Print a Form to a report
« on: August 03, 2016, 03:29:36 PM »
Not sure of the validity, but found this .. http://stackoverflow.com/questions/18191893/generate-pdf-from-html-in-div-using-javascript.
Might be helpful, using a javascript library to create a pdf from html.
Might be helpful, using a javascript library to create a pdf from html.
62
Web Server - Ask For Help / Re: Where to Rename PDF before emailing
« on: July 25, 2016, 03:59:03 PM »
Just for any future reference to this.
You absolutely can rename files in Webhandler, and if you're building a system that allows people to download files from links (ie, here's a link instead of an attachment), then it's a great thing to understand.
_SendFile, before the Parent Call, is where you can do it.
The thinking is, simply, if I rename a file then it's something I want the person to download (because in here all kinds of things are dealt with).
My code is:
* found# is saying "yes, the file is here"
* str4 has the filename that I used to create the pdf report
* str5 gets the filename, removes the $$$ (which is used to tell the webserver it's a temp report)
* We use our own call to _SendFile and content stuff etc, to make sure the file is downloaded the way we want
(attachment shows the else / end code that wraps the parent call)
Hope that helps someone in the future.
You absolutely can rename files in Webhandler, and if you're building a system that allows people to download files from links (ie, here's a link instead of an attachment), then it's a great thing to understand.
_SendFile, before the Parent Call, is where you can do it.
The thinking is, simply, if I rename a file then it's something I want the person to download (because in here all kinds of things are dealt with).
My code is:
Code: [Select]
!** SEND the actual file **
if (found# = 1)
Debug('('&sa:ProcedureName&', Rewrite) Sending file: '&clip(str4.GetValue()))
str5.SetValue(str4.FileNameOnly())
str5.Replace('$$$','')
Debug('('&sa:ProcedureName&', Rewrite) Filename: '&str5.GetValue())
PARENT.ForceNoCache = 1
PARENT.HeaderDetails.ContentDisposition = 'attachment;filename="'&str5.GetValue()&'"'
PARENT._SendFile(str4.GetValue(),p_header)
str4.Free()
else* found# is saying "yes, the file is here"
* str4 has the filename that I used to create the pdf report
* str5 gets the filename, removes the $$$ (which is used to tell the webserver it's a temp report)
* We use our own call to _SendFile and content stuff etc, to make sure the file is downloaded the way we want
(attachment shows the else / end code that wraps the parent call)
Hope that helps someone in the future.
63
Web Server - Ask For Help / Re: Trouble with an EIP checkbox and child browse disappearing
« on: June 09, 2016, 02:03:50 AM »
Champion! Thank you sir.
64
Web Server - Ask For Help / Re: Trouble with an EIP checkbox and child browse disappearing
« on: June 02, 2016, 03:04:22 PM »
Little friendly bump for Bruce!
65
Web Server - Ask For Help / Re: Compile error: To many segdef in file:4A,4000
« on: May 27, 2016, 08:13:57 PM »
Figured we needed something linkable to this question/problem.
https://clarionhub.com/t/too-many-segdef-compiler-error/570
https://clarionhub.com/t/too-many-segdef-compiler-error/570
66
Web Server - Ask For Help / Re: Trouble with an EIP checkbox and child browse disappearing
« on: May 27, 2016, 07:46:56 PM »
Hi Bruce,
I've managed to replicate in Accounts (31).
With my code it happens reliably every time. With the example there were some clicks that the child browse appears for, some it doesn't.
Attached.
Instructions:
1. Go to Invoices.
2. Click the mouse on the checkbox in the Invoices browse.
3. Child browse should disappear.
4. Repeat 2. a few times.
5. In my code (and in the example when it breaks), click on the row anywhere else (not the checkbox) to bring back the child browse.
Cheers.
I've managed to replicate in Accounts (31).
With my code it happens reliably every time. With the example there were some clicks that the child browse appears for, some it doesn't.
Attached.
Instructions:
1. Go to Invoices.
2. Click the mouse on the checkbox in the Invoices browse.
3. Child browse should disappear.
4. Repeat 2. a few times.
5. In my code (and in the example when it breaks), click on the row anywhere else (not the checkbox) to bring back the child browse.
Cheers.
67
Web Server - Ask For Help / Re: How do I set the reply to address when I use Nettalk to send emails ?
« on: April 21, 2016, 02:07:03 AM »68
Web Server - Ask For Help / Re: Trouble with an EIP checkbox and child browse disappearing
« on: April 07, 2016, 03:32:45 AM »
Am just looking for some idea, some direction. I can't get it to happen in an example as said above.
I guess it's just something I'll have to work around.
I guess it's just something I'll have to work around.
69
Web Server - Ask For Help / Re: Trouble with an EIP checkbox and child browse disappearing
« on: April 06, 2016, 01:17:18 PM »
Bump.
Looking at this again, the problem seems to be that the <response> element for the browse doesn't appear where it should (according to the working example response).
It's working out _why_ it's not appearing that has got me stumped. The browse is a child browse. No special filters on it except that of the parent guid.
As was in the original post (the pictures I think) the browse gets run (debug logged the browse filter), but then gets hidden.
So need to work out how it is being hidden (via some template option or possibility?).
Any ideas on that would be really helpful.
Thanks.
Looking at this again, the problem seems to be that the <response> element for the browse doesn't appear where it should (according to the working example response).
It's working out _why_ it's not appearing that has got me stumped. The browse is a child browse. No special filters on it except that of the parent guid.
As was in the original post (the pictures I think) the browse gets run (debug logged the browse filter), but then gets hidden.
So need to work out how it is being hidden (via some template option or possibility?).
Any ideas on that would be really helpful.
Thanks.
70
Web Server - Ask For Help / Re: Trouble with an EIP checkbox and child browse disappearing
« on: March 31, 2016, 05:25:37 PM »
Okay, so having a look at the responses in firebug, for the problem system (missing child browse) and the accounts example (works fine).
1. Accounts example, EIP Checkbox response:
2. Problem system, EIP Checkbox response:
-
So the first thing I see is that the encoding is different. Seems strange, I haven't touched anything to do with encoding. Would this make any difference? [Edit: Changed to the iso charset, didn't change anything here in this issue]
Second thing is that yes, there is a "browselineitems_browseinvoices_header_div" <response> and <div> in the working example that isn't in the not-working example.
However, the commented <!-- w_InvoiceLoads_Items_Browse_table_div --> line is in the not-working, as the counterpart in the working example.
-
Any thoughts on where to go from here?
1. Accounts example, EIP Checkbox response:
Code: [Select]
<?xml version="1.0" encoding="iso-8859-1"?>
<ajax-response>
<response type="element" id="browselineitems_browseinvoices_header_div">
<div id="browselineitems_browseinvoices_header_div" class="nt-header nt-browse-header"></div>
</response>
<response type="element" id="browselineitems_browseinvoices_table_div">
<div id="browselineitems_browseinvoices_table_div" class="ui-widget">
</div><!-- BrowseLineItems_table_div -->
</response>
<response type="script">
document.title = "Invoices";
$('#browselineitems_browseinvoices_div').ntbrowse('hideLocator');
$('#browselineitems_browseinvoices_div').ntbrowse('hideNav');
$('#browselineitems_browseinvoices_div').ntbrowse('hideFormButtons',true);
$('#browselineitems_browseinvoices_div').ntbrowse('refresh',"");
$('#browselineitems_browseinvoices_div').ntbrowse('hide');
</response>
</ajax-response>2. Problem system, EIP Checkbox response:
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<ajax-response>
<response type="element" id="w_invoiceloads_items_browse_w_invoiceloads_browse_table_div">
<div id="w_invoiceloads_items_browse_w_invoiceloads_browse_table_div" class="ui-widget">
</div><!-- w_InvoiceLoads_Items_Browse_table_div -->
</response>
<response type="script">
$('#w_invoiceloads_items_browse_w_invoiceloads_browse_div').ntbrowse('hideLocator');
$('#w_invoiceloads_items_browse_w_invoiceloads_browse_div').ntbrowse('hideNav');
$('#w_invoiceloads_items_browse_w_invoiceloads_browse_div').ntbrowse('hideFormButtons',true);
$('#w_invoiceloads_items_browse_w_invoiceloads_browse_div').ntbrowse('refresh',"");
$('#w_invoiceloads_items_browse_w_invoiceloads_browse_div').ntbrowse('hide');
$('#w_InvoiceLoads_Search_frm').ntform('ready');
</response>
</ajax-response>-
So the first thing I see is that the encoding is different. Seems strange, I haven't touched anything to do with encoding. Would this make any difference? [Edit: Changed to the iso charset, didn't change anything here in this issue]
Second thing is that yes, there is a "browselineitems_browseinvoices_header_div" <response> and <div> in the working example that isn't in the not-working example.
However, the commented <!-- w_InvoiceLoads_Items_Browse_table_div --> line is in the not-working, as the counterpart in the working example.
-
Any thoughts on where to go from here?
71
Web Server - Ask For Help / Re: Programmatically (without user intervention) run javascript using NT9
« on: March 29, 2016, 07:40:16 PM »
Nevermind about this rabbit-hole, got the task solved using a combination of fileexplorer in the client to "run" the custom javascript html page, and then a little webserver that handles the base64 image url that is generated by the graph engine (uses toDataURL, which is a html5 thing apparently).
Cheers.
Cheers.
72
Web Server - Ask For Help / Trouble with an EIP checkbox and child browse disappearing
« on: March 28, 2016, 04:16:42 PM »
Hi Folks,
Nettalk 9 (latest)
Clarion 10 (11975)
MSSQL driver
Am experiencing the following issue:
A parent and child browse, where the parent has a checkbox EIP field (local variable). When the user clicks on the checkbox in the parent browse (and does nothing else, doesn't click on the row itself except for the checkbox) the child browse disappears.
Clicking on the row (not the checkbox) will bring the child browse back.
First things - I can't replicate this in an example (tried Accounts). The process works fine with the Accounts example.
So it might, possibly, be an MSSQL thing. Not sure yet.
Testing further, I turned on the debug options for both the browses. The two browse names are w_InvoiceLoads_Browse and w_InvoiceLoads_Items_Browse.
First attachment image is the debug log for when the checkbox is ticked.
Second image is the debug log for when the row is clicked.
There is the obvious difference of the EIPAccepted call, but there's also a (ParentSilent=1) log. Might be something.
Any ideas what might be happening?
Nettalk 9 (latest)
Clarion 10 (11975)
MSSQL driver
Am experiencing the following issue:
A parent and child browse, where the parent has a checkbox EIP field (local variable). When the user clicks on the checkbox in the parent browse (and does nothing else, doesn't click on the row itself except for the checkbox) the child browse disappears.
Clicking on the row (not the checkbox) will bring the child browse back.
First things - I can't replicate this in an example (tried Accounts). The process works fine with the Accounts example.
So it might, possibly, be an MSSQL thing. Not sure yet.
Testing further, I turned on the debug options for both the browses. The two browse names are w_InvoiceLoads_Browse and w_InvoiceLoads_Items_Browse.
First attachment image is the debug log for when the checkbox is ticked.
Second image is the debug log for when the row is clicked.
There is the obvious difference of the EIPAccepted call, but there's also a (ParentSilent=1) log. Might be something.
Any ideas what might be happening?
73
Web Server - Ask For Help / Re: Programmatically (without user intervention) run javascript using NT9
« on: March 28, 2016, 04:08:13 PM »
Hi Bruce,
Yup, I realise that the webserver cannot normally run javascript.
But I'm asking if it can be made to.
Let me explain further.
I've got a javascript library that creates graphs.
I need to programatically be able to say "get me this graph", which calls javascript that saves an image file on disk, and then my code can take that file and do something with it.
I'm still wrestling with using FE5 to do this, having issues with Internet Explorer in FE5.
Another direction is that the guy who makes the graphing javascript engine pointed me to http://phantomjs.org/, so might see if that can get shoe-horned in somewhere.
Yup, I realise that the webserver cannot normally run javascript.
But I'm asking if it can be made to.
Let me explain further.
I've got a javascript library that creates graphs.
I need to programatically be able to say "get me this graph", which calls javascript that saves an image file on disk, and then my code can take that file and do something with it.
I'm still wrestling with using FE5 to do this, having issues with Internet Explorer in FE5.
Another direction is that the guy who makes the graphing javascript engine pointed me to http://phantomjs.org/, so might see if that can get shoe-horned in somewhere.
74
Web Server - Ask For Help / Re: Programmatically (without user intervention) run javascript using NT9
« on: March 23, 2016, 01:58:35 PM »
Okay 
Can I get the webserver to receive a url, run some javascript which will save a file to disk, then return that file to whatever called the url?
The part I have a problem understanding is the midding "run some javascript". I'm good with receiving the url and returning the file.

Can I get the webserver to receive a url, run some javascript which will save a file to disk, then return that file to whatever called the url?
The part I have a problem understanding is the midding "run some javascript". I'm good with receiving the url and returning the file.
75
Web Server - Ask For Help / Programmatically (without user intervention) run javascript using NT9
« on: March 22, 2016, 05:10:42 PM »
Hi Bruce/Folks,
At the moment I'm currently wrangling with File Explorer 5, getting it/IE to run a custom built html page which has some javascript in it.
Basically it's a graphing engine, javascript, and I'm trying to get the graphs saved to disk programatically by running the code and calling the built-in save function.
Was thinking that perhaps ..
1. In the webhandler of a webserver, if the "download graph image" url is called with whatever credential checks, then potentially (like downloading a custom-built pdf) I could get the server to send back an image, that I could use in a NetWebClient object by calling .Fetch() and seeing how that goes.
What thinkest thou(s)?
Stu
At the moment I'm currently wrangling with File Explorer 5, getting it/IE to run a custom built html page which has some javascript in it.
Basically it's a graphing engine, javascript, and I'm trying to get the graphs saved to disk programatically by running the code and calling the built-in save function.
Was thinking that perhaps ..
1. In the webhandler of a webserver, if the "download graph image" url is called with whatever credential checks, then potentially (like downloading a custom-built pdf) I could get the server to send back an image, that I could use in a NetWebClient object by calling .Fetch() and seeing how that goes.
What thinkest thou(s)?
Stu