Hello,
I wanted to know if we can save or export the output of a CC4 custom code report in a CSV or Excel file. I have searched a lot but not found a clear answer. I do not want to CF as it will require me to rebuild the complex logic all over again. Can I save the data output on the screen or more columns to a file somehow.
Thanks
Amal
I wanted to know if we can save or export the output of a CC4 custom code report in a CSV or Excel file. I have searched a lot but not found a clear answer. I do not want to CF as it will require me to rebuild the complex logic all over again. Can I save the data output on the screen or more columns to a file somehow.
Thanks
Amal
Hi Amal,
Sorry but what's the "CC4 custom code report" ? if you just want export records to CSV file then you can add a custom action to your connection and connect it to your form, and there you can use the CF CSV backup action, you may have to adjust the data passed to the action using a "custom code" action first though!
Regards,
Max
Sorry but what's the "CC4 custom code report" ? if you just want export records to CSV file then you can add a custom action to your connection and connect it to your form, and there you can use the CF CSV backup action, you may have to adjust the data passed to the action using a "custom code" action first though!
Regards,
Max
Max,
By "CC4 custom code report" what I meant was Chronoconnectivity Version 4 connection. What we create in CC is primarily a report or query so I used the word report for the connection I have created. I had read the solution you mentioned in another post but I would appreciate if you can give an example with code. I think it will benefit a lot of people.
I see the comment "list of form events to be processed when they are used as task parameter in the connection page, a list of records will be loaded if the cb value is provided." in "Custom Data tasks". Looks like I can get all the of the CC connection output in an array. Is that correct. I can then use the CFv4 CSV Export v2 [GH] action to export. Is that the way. I created a form cf_ExportData with a ip_ExportData button and nothing else. Would appreciate if you can give the steps & code.
Thanks
Amal
By "CC4 custom code report" what I meant was Chronoconnectivity Version 4 connection. What we create in CC is primarily a report or query so I used the word report for the connection I have created. I had read the solution you mentioned in another post but I would appreciate if you can give an example with code. I think it will benefit a lot of people.
I see the comment "list of form events to be processed when they are used as task parameter in the connection page, a list of records will be loaded if the cb value is provided." in "Custom Data tasks". Looks like I can get all the of the CC connection output in an array. Is that correct. I can then use the CFv4 CSV Export v2 [GH] action to export. Is that the way. I created a form cf_ExportData with a ip_ExportData button and nothing else. Would appreciate if you can give the steps & code.
Thanks
Amal
Hi Amal,
No code is required if its done correctly, first thing is to make sure that you connected your connection to the form's custom action, by adding a debugger action to check the data passed, if its good then use the CSV action instead.
The data passed should be captured by the CSV action, you can use the "Data path" setting for that, instead of using the table setting to get the csv data.
Regards,
Max
No code is required if its done correctly, first thing is to make sure that you connected your connection to the form's custom action, by adding a debugger action to check the data passed, if its good then use the CSV action instead.
The data passed should be captured by the CSV action, you can use the "Data path" setting for that, instead of using the table setting to get the csv data.
Regards,
Max
Max / GreyHead,
I am unable to do this. As a first step I created a simple single button form as given in your CSV Export [GH] document. I used CSV Export v2 [GH] action. Even that didn't work so I haven't been able to test your solution to take data from CCv4 to CFv4. I did the exact steps as mentioned in your one page tutorial and I only get a blank screen with link:
http://localhost/mysite/index.php/export2?chronoform=cf_export&event=submit
No files are created or downloaded. Let me know what could be the reason for it not to work.
Can you help me get the basic CSV export going, I can't even get that working. I read many detailed posts on this in your forum and did exact steps as given in your example but no result. I am using Joomla 3.2 and CFv4.
Thanks, Amal
I am unable to do this. As a first step I created a simple single button form as given in your CSV Export [GH] document. I used CSV Export v2 [GH] action. Even that didn't work so I haven't been able to test your solution to take data from CCv4 to CFv4. I did the exact steps as mentioned in your one page tutorial and I only get a blank screen with link:
http://localhost/mysite/index.php/export2?chronoform=cf_export&event=submit
No files are created or downloaded. Let me know what could be the reason for it not to work.
Can you help me get the basic CSV export going, I can't even get that working. I read many detailed posts on this in your forum and did exact steps as given in your example but no result. I am using Joomla 3.2 and CFv4.
Thanks, Amal
GreyHead,
Quick reply, the error "Fatal error: Class 'JFolder' not found in E:\Wamp\www\mysite\administrator\components\com_chronoforms\form_actions\csv_export_v2_gh\csv_export_v2_gh.php on line 121".
The code on line 121 is
Any hints on what could be the issue.
Thanks, Amal
Quick reply, the error "Fatal error: Class 'JFolder' not found in E:\Wamp\www\mysite\administrator\components\com_chronoforms\form_actions\csv_export_v2_gh\csv_export_v2_gh.php on line 121".
The code on line 121 is
if ( !JFolder::create( $save_path ) ) {
$form->debug['CSV Export'][] = "Couldn't create save folder: {$save_path}";
JError::raiseWarning( 100, "Couldn't create save folder: {$save_path}" );
$this->events['fail'] = 1;
return;
}
Any hints on what could be the issue.
Thanks, Amal
Bob,
Like I wrote in my previous post Joomla 3.2.1 and CFv4. I added
lines it seems to be ok. Not sure if that is the right way to do it.
Thanks, Amal
Like I wrote in my previous post Joomla 3.2.1 and CFv4. I added
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
lines it seems to be ok. Not sure if that is the right way to do it.
Thanks, Amal
Bob / Max,
I think this is getting complicated. I already have a form attached to allow editing a single record from my CCv4 connection. Getting another form in tne picture will not be possible. I can think of a simpler way but am unable to get it going, probably my lack of knowledge about CF & php. I think you can do this in 15-20minutes. Below is a code which I have copied from web and put in footer. The problem is it doesn't accept $form->data. If I understand it correctly $form->data[0] is 1st record, $form->data[1] is 2nd record & so on. The $form->data[0]['cf_id'] contains 1st field cf_id & so on. Can you write a small code to get all fields, put their values in an array & fputcsv them line by line. Does this look feasible? Another issue is that this downloads file every time CCv4 connection is invoked, it should be optional.
I would appreciate if anyone can modify this to print all the rows (also showing in debugger array) into a csv file. Shouldn't be very complex.
Thanks, Amal
I think this is getting complicated. I already have a form attached to allow editing a single record from my CCv4 connection. Getting another form in tne picture will not be possible. I can think of a simpler way but am unable to get it going, probably my lack of knowledge about CF & php. I think you can do this in 15-20minutes. Below is a code which I have copied from web and put in footer. The problem is it doesn't accept $form->data. If I understand it correctly $form->data[0] is 1st record, $form->data[1] is 2nd record & so on. The $form->data[0]['cf_id'] contains 1st field cf_id & so on. Can you write a small code to get all fields, put their values in an array & fputcsv them line by line. Does this look feasible? Another issue is that this downloads file every time CCv4 connection is invoked, it should be optional.
<?php
$fiilename = 'file.csv';
header( "Content-Type: text/csv;charset=utf-8" );
header( "Content-Disposition: attachment;filename=\"$filename\"" );
header("Pragma: no-cache");
header("Expires: 0");
$fp= fopen('php://output', 'w');
foreach ($form->data as $fields)
{
fputcsv($fp, $fields);
}
fclose($fp);
exit();
?>
I would appreciate if anyone can modify this to print all the rows (also showing in debugger array) into a csv file. Shouldn't be very complex.
Thanks, Amal
Hi amsharma,
I would add an 'Export' link (or a form button) at the top of the listing and connect that to a form that uses the CSV Export action to create the file. The question then is how to pass the data to specify the listing if it is not to be all the records in the file.
Bob
PS You are right about the fix required for Joomla! 3, I've updated the action on my site to include it.
Bob
I would add an 'Export' link (or a form button) at the top of the listing and connect that to a form that uses the CSV Export action to create the file. The question then is how to pass the data to specify the listing if it is not to be all the records in the file.
Bob
PS You are right about the fix required for Joomla! 3, I've updated the action on my site to include it.
Bob
This topic is locked and no more replies can be posted.