Page 1 of 1

PostPosted: Mon Jan 22, 2007 1:17 pm
by dwisn
before I go hacking my way through SQL, and since I haven't found any code in the forums ( at least where/what I have searched on ):

Does anyone have any code for Saving the output of "found records" into a file of any sort? I know Dadabik has an "Export to CSV", just wondered if anyone has written anything -

In advance,
I thank you -
dan

PostPosted: Mon Jan 22, 2007 3:19 pm
by shannah
Hi Dan,

People have been asking for this one for a while and its so easy to do, so I thought I'd just whip it up. Download the new release of Dataface 0.6.11 at http://sourceforge.net/project/showfiles.php?group_id=153729&package_id=170571&release_id=480550

If you don't want to have to upgrade the whole thing, you could actually just copy the actions.ini file and the actions/export_csv.php file into your dataface distribution and it should work ok.

Only tested on PHP 5 so far.

-Steve

PostPosted: Mon Jan 22, 2007 3:20 pm
by shannah
Oh.. yeah..
The way it works is:

In the List view and related records list view, you'll notice a little icon that looks like a spread sheet in the upper right corner of the result set. Click on that to export the results to CSV format.

Best regards

Steve

PostPosted: Mon Jan 22, 2007 3:45 pm
by dwisn
Hi Dan,

>

People have been asking for this one for a while and its so easy to do, so I thought I'd just whip it up. Download the new release of Dataface 0.6.11 at http://sourceforge.net/project/showfiles.php?group_id=153729&package_id=170571&release_id=480550

>

If you don't want to have to upgrade the whole thing, you could actually just copy the actions.ini file and the actions/export_csv.php file into your dataface distribution and it should work ok.

>

Only tested on PHP 5 so far.

>

-Steve



Thanks - I'll give it the test. I had just downloaded 6.10

dan

PostPosted: Mon Jan 22, 2007 3:45 pm
by dwisn
Hi Dan,

>

People have been asking for this one for a while and its so easy to do, so I thought I'd just whip it up. Download the new release of Dataface 0.6.11 at http://sourceforge.net/project/showfiles.php?group_id=153729&package_id=170571&release_id=480550

>

If you don't want to have to upgrade the whole thing, you could actually just copy the actions.ini file and the actions/export_csv.php file into your dataface distribution and it should work ok.

>

Only tested on PHP 5 so far.

>

-Steve



Thanks - I'll give it the test. I had just downloaded 6.10

dan

PostPosted: Mon Jan 22, 2007 4:25 pm
by dwisn
>If you don't want to have to upgrade the whole thing, you could actually just copy the actions.ini file and the actionsexport_csv.php file into your dataface distribution and it should work ok.

1 ( one) error in export_csv.php

TOP line missing an "f"

if ( !function_exists('putcsv') ){

should be
if ( !function_exists('fputcsv') ){ ( I think )

Though now I'm getting:
Fatal error: Class 'actions_find' not found in ~/dataface-0.6.11/Dataface/Application.php on line 763

trying to work through it
dan

PostPosted: Mon Jan 22, 2007 4:35 pm
by dwisn


>
>If you don't want to have to upgrade the whole thing, you could actually just copy the actions.ini file and the actionsexport_csv.php file into your dataface distribution and it should work ok.

>

1 ( one) error in export_csv.php

>

TOP line missing an "f"

>

if ( !function_exists('putcsv') ){

>

should be

>if ( !function_exists('fputcsv') ){ ( I think )



>Though now I'm getting:

Fatal error: Class 'actions_find' not found in ~/dataface-0.6.11/Dataface/Application.php on line 763

>

trying to work through it

>dan




GRRRRRRRRRRRRRRRRRRRRRRRRRRRRR:::: DAMN IE EXPORER........

Firefox... OK

Thanks again Steve... I will now look how ACtions work.. and start learning with this as a basis.

dan


PostPosted: Tue Jan 23, 2007 8:05 am
by dwisn
#1 ) Thanks again Steve, you saved my butt
#2 ) I promise, I'll start learning framework....

&3 ) For anyone having issues using MS IE and trying to download across SSL and having problems... I found a fix that works...


For a per-computer setting, locate the following registry key:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings
On the Edit menu, click Add Value, and then add the following registry values:
"BypassSSLNoCacheCheck"=Dword:00000001


PER USER SETTING
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet
Settings
"BypassSSLNoCacheCheck"=Dword:00000001

PostPosted: Tue Jan 23, 2007 12:31 pm
by shannah
Wow... thanks for finding this fix... I can safely say that I never would have found that.

-Steve

PostPosted: Tue Jan 23, 2007 1:04 pm
by dwisn
The MS IE fix? Its official @ http://support.microsoft.com/kb/323308

PostPosted: Wed May 23, 2007 2:55 am
by danny
Hi Steve,

just was wondering if there«s an export function too. But found the solution (just like so many more before) on your site. It«s awesome how one person is managing such an impressive support! Thanx a lot!

But one suggestion about this feature (export): I believe it would be better placed beside the import-action (in the actions row). Why "hide" such a useful function...

Daniel

PostPosted: Wed May 23, 2007 8:26 am
by shannah

Hi Daniel,

You an move the export function to be beside the import function by adding the following to your application's actions.ini file (if you're using Dataface 0.7)

[export_csv > export_csv]
category=table_actions

What this does is override the export_csv action to be in the "table_actions" category.Ê The "category" is what dataface uses to know where to display different actions.


Best regards
steve

PostPosted: Thu May 24, 2007 12:59 am
by danny
Works perfectly! Thanx a lot, Steve.
I«m very curious about all the other features not documented yet

PostPosted: Tue Jul 21, 2009 7:20 am
by danw
dwisn wrote: #1 ) Thanks again Steve, you saved my butt
#2 ) I promise, I'll start learning framework....

&3 ) For anyone having issues using MS IE and trying to download across SSL and having problems... I found a fix that works...


For a per-computer setting, locate the following registry key:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings
On the Edit menu, click Add Value, and then add the following registry values:
"BypassSSLNoCacheCheck"=Dword:00000001


PER USER SETTING
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet
Settings
"BypassSSLNoCacheCheck"=Dword:00000001



I HAVE AN UPDATE.. TESTED ACROSS SSL XP ServicePack 3 07/19/2009
In ~/actions

file export_csv.php

current lines:

header("Content-type: text/csv; charset={$app->_conf['oe']}");
header('Content-disposition: attachment; filename="'.$query['-table'].'_results_'.date('Y_m_d_H_i_s').'.csv"');


add:
header("Content-type: text/csv; charset={$app->_conf['oe']}");
header("Pragma: public");
header('Content-disposition: attachment; filename="'.$query['-table'].'_results_'.date('Y_m_d_H_i_s').'.csv"');

and this solved the issue. you should not have to edit within regedit

PostPosted: Tue Jul 21, 2009 12:01 pm
by shannah
Thanks for the tip. I have added this to the issue tracker so that it will be fixed when I get a chance.

http://bugs.weblite.ca/view.php?id=562
-Steve