Installation

VJ SQL to File is installed using standard Joomla! installation procedure in Joomla! back-end: Extensions -> Extension Manager -> Upload Package File.
VJ SQL to File component and VJ SQL to File module are installed.
VJ SQL to File component is configured in Components -> VJ SQL to File and is used to manage files and queries.
VJ SQL to File module is configured in Extensions -> Module Manager -> VJ SQL to File and can be used to place links to download files in module positions or articles.
VJ SQL to File with Params module is configured in Extensions -> Module Manager -> VJ SQL to File with Params and can be used to download files using query with parameters passed from user.


Usage


List of queries

To view queries go to Components -> VJ SQL to File -> Queries. The view displays available queries, it's possible to create new query, remove or edit existing queries.
Links in appropriate columns will take admin to edit appropriate query.
Queries can be created and saved for later use - for example, you can use the same query to generate files of different types.



Add/edit query

By clicking New button admin will be taken to the page to add new query.
Query specifies SQL query to use. When using Joomla! database, #__ prefix is automatically replaced with Joomla! database table prefix.
Database type specifies the type of database to retrieve data from. To work with some databases appropriate php extension may need to be installed and enabled. If database type is other than Joomla! database then connection string field appears. Connection String should be in format: SERVER,DATABASE_NAME,USER,PASSWORD.


List of files

To view files go to Components -> VJ SQL to File -> Files. The view displays available files, it's possible to create, edit, delete files.
Link in Title column opens appropriate file to edit.
Link in Download column will run associated with file SQL query, generate file of indicated type and allow to download it. This link can be copied and placed into modules, articles, etc.



Add/edit file

Title indicates the title of the file item, this is used to easily distinguish files.
File name indicates the name that downloaded file will have. For example, file.xls for Excel, file.doc for DOC, file.pdf for PDF, etc.
Query - it's possible to use queries created in Components -> VJ SQL to File -> Queries or use new one.
Database type specifies the type of database to retrieve data from. To work with some databases appropriate php extension may need to be installed and enabled. If database type is other than Joomla! database then connection string field appears. Connection String should be in format: SERVER,DATABASE_NAME,USER,PASSWORD.



Using links on front-end

It's easy to copy and paste links from download column in Components -> VJ SQL to File -> Files.
To place links in a module position it's possible to use module in Extensions -> Module Manager -> VJ SQL to File.

Link indicates the link to use.
Text with the link represents the text, where LINK will be automatically replaced with chose link.
Link title indicates the text for the link.
Module Class Suffix indicates specifies CSS class to be applied to this module instance.
Module Assignment in Menu Assignment tab allows to assign module to the pages to be displayed on.
Position in Details tab allows to set module position to render module in. To place the module in an article assign some unique position to it like pos1, publish module and assign it to all pages. Then place {loadposition pos1} code into article to show the module in it.



VJ SQL to File with Params module

To place links and pass parameters from user it's possible to use module in Extensions -> Module Manager -> VJ SQL to File with Params.
Query should look like:

PARAM1, PARAM2, PARAM3 in a query can be replaced with values user enters on front-end.

Link indicates the link to use.
Text with the link represents the text, where LINK will be automatically replaced with chose link.
Link title indicates the text for the link.
Module Class Suffix indicates specifies CSS class to be applied to this module instance.
Module Assignment in Menu Assignment tab allows to assign module to the pages to be displayed on.
Position in Details tab allows to set module position to render module in. To place the module in an article assign some unique position to it like pos1, publish module and assign it to all pages. Then place {loadposition pos1} code into article to show the module in it.

Param 1 Text, Param 2 Text, Param 3 Text are the labels to show for user to insert values.

On front-end module allows user to type values and pass them as query parameters.