Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Download to CSV

Questions related to customising nuBuilder Forte with JavaScript or PHP.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Download to CSV

Unread post by kev1n »

Replace DownloadCSV with BrowseDownloadToCSV

Code: Select all

if(nuFormType() == 'browse'){
    nuAddActionButton('nuRunPHPHidden', 'Download to CSV', 'nuSetProperty("browse_sql",nuCurrentProperties().browse_sql); nuRunPHP("BrowseDownloadToCSV")');
}
mariri
Posts: 45
Joined: Mon Sep 02, 2019 11:54 am

Re: Download to CSV

Unread post by mariri »

I've already done that and I have a CSV file with my data in output. But in this document I also have an HTML code, I don't know why :cry:
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Download to CSV

Unread post by kev1n »

Replace

Code: Select all

if (strpos(fileName, '#') === false) {
with

Code: Select all

if (strpos($fileName, '#') === false) {
mariri
Posts: 45
Joined: Mon Sep 02, 2019 11:54 am

Re: Download to CSV

Unread post by mariri »

Great it works now ! Stupid mistake that I did somehow :mrgreen:

Thanks !
ricklincs
Posts: 107
Joined: Mon Aug 01, 2011 5:39 pm
Has thanked: 33 times

Re: Download to CSV

Unread post by ricklincs »

I have tried ke1vin example and I get

/nurunphp.php?i=5f44e33c6aea3ad in my browser with no download of a csv file when I click the Download to CSV button on my browse screen

Is this something that has changed with Browser security?

Thank you
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Download to CSV

Unread post by kev1n »

Hi,

A popup-blocker might be preventing the download.
For me, the download works in Chrome, Firefox, Edge (The latter two show a popup message)
ricklincs
Posts: 107
Joined: Mon Aug 01, 2011 5:39 pm
Has thanked: 33 times

Re: Download to CSV

Unread post by ricklincs »

Hi ke1vin,

Doesn't look like its a popup-blocker, have tried it on an older pc and after allowing popups it opens a blank window with www......./nurunphp.php?i=5f4516222d74de3
I have tried on Chrome, Firefox, Edge, Opera and still the same result. When clicking the print button a new window appears with all the correct info with www...../nurunhtml.php?i=5f4517446b2e30c.

Thanks
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Download to CSV

Unread post by kev1n »

Is Run set to "Hidden" in the Procedure?
You do not have the required permissions to view the files attached to this post.
ricklincs
Posts: 107
Joined: Mon Aug 01, 2011 5:39 pm
Has thanked: 33 times

Re: Download to CSV

Unread post by ricklincs »

Hi Ke1vin

Yes Run is set to Hidden in the Procedure.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Download to CSV

Unread post by kev1n »

So I tried on three different computers (windows) with different browsers. It always works for me.

Try if "Download to CSV" works in my sample db:
http://nubuilder.epizy.com/index.php?f= ... est&p=test
Post Reply