Filter Connection using Date Range and Export Data into CSV

annekm 08 May, 2017
Hi

I am using ChronoConnectivity6 to generate reports.

I used this link https://www.chronoengine.com/faqs/73-chronoconnectivity-v6/5283-build-a-basic-listing.html as a demo.

I have a following Queries:

1) I have created 2 fields for From Date and To Date. I would like to filter for values between these dates. For a dropdown filed, the filtering condition used for the View was "CBDBF.cb_chapter:{data:chapterselect}".

What's the syntax for creating the BETWEEN clause, in the Filtering Settings- Where conditions?

2) I created a Download CSV function. The downloaded file is empty. I would like a clear set of instructions on how to make this work. I would like to achieve a download of all data, (filtered or complete) to be downloaded. Please help me achieving this.

From what I have been exploring this past week, this tool seems to be pretty impressive. Kudos to the team.
Max_admin 08 May, 2017
Hi annekm,

#1- don't use between, try to use > AND <

CBDBF.cb_chapter/>=:{data:chapterselect}
CBDBF.cb_chapter/<=:{data:chapterselect}


#2- the CSV needs a numeric array or data sets, the read data returns and associative array, so in the data provider of the CSV you need to write this:

{var:read_data_fn_name.[n].MODEL_NAME}


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
annekm 09 May, 2017
Hi Max,

Thanks for your response.
+
#1 works perfectly. I used the following code:


CBSubsDBF.subscription_date/>=:'{data:fromdate}'
AND
CBSubsDBF.subscription_date/<=:'{data:todate}'


#2 still is not working. I am not sure if my config is correct. I am attaching screenshots of my config. Can you please point out the issue?

Regards,
Annekm
Max_admin 09 May, 2017
Hi Annekm,

In image #3, you are calling the downloadcsv BEFORE the read_data, this is wrong as there is no data yet available for the csv function to process.

Also the line above debug is useless here, but it should print the read_data list if this is what you need, but its already shown in the debug anyway.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
annekm 09 May, 2017
Hi Max,

You were right. The data was downloaded after changing the order of the function read before the call of the function download.

Now I am able to download the data. Thank you.

The data that is being downloaded is only the 1st page that is displayed on screen i.e., 30 records. Is it possible to download all the records?

I don't use selectors in my table view. Is this is the reason?

Also I have created filter finctions for my data. Can the same button be used to download the data from that view?

In my read function, I have multiple data models. Can I select the columns from different data models that need to be downloaded? If so, where do I configure the same?

The following is the link displaying my connection for your reference:

This is private content




Thanks for your timely responses.

Regards,
Annekm
Max_admin 09 May, 2017
Hi Annekm,

The data that is being downloaded is only the 1st page that is displayed on screen i.e., 30 records. Is it possible to download all the records?
Please disable the pagination setting under the "read data" function or change the page limit to include all records.

Also I have created filter finctions for my data. Can the same button be used to download the data from that view?
I could not understand this, the csv function gets a data set and converts it to a file, so if you can provide the filtered data then it should work.

In my read function, I have multiple data models. Can I select the columns from different data models that need to be downloaded? If so, where do I configure the same?
This is tricky, I will try to think about any easy way but you can use a PHP function to build the data array and "return" it, then use {var:php_fn_name} in the "data provider" of the csv function.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.