NetTalk Central

Show Posts

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.


Messages - Stu

Pages: 1 ... 3 4 [5] 6 7 ... 33
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.

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:

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
Champion! Thank you sir.

64
Little friendly bump for Bruce!

65
Figured we needed something linkable to this question/problem.

https://clarionhub.com/t/too-many-segdef-compiler-error/570

66
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.

67
Hi Mike,

Usually something like:

Code: [Select]
ThisEmailSend.ReplyTo = 'coolio@thereyougo.com'

68
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.

69
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.

70
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:

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 = &quot;Invoices&quot;;
$('#browselineitems_browseinvoices_div').ntbrowse('hideLocator');
$('#browselineitems_browseinvoices_div').ntbrowse('hideNav');
$('#browselineitems_browseinvoices_div').ntbrowse('hideFormButtons',true);
$('#browselineitems_browseinvoices_div').ntbrowse('refresh',&quot;&quot;);
$('#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',&quot;&quot;);
$('#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
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.

72
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?

73
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.

74
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.

75
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

Pages: 1 ... 3 4 [5] 6 7 ... 33