• Hi Eli,

    Thank you for writing such a useful plugin.

    Q1: I was wondering if I can paginate a report, for example:

    SQL: select text from book_table where book_id=1
    this query will return 1500 records
    Would it be possible to display a
    <Previous> 1 2 3 4 5 6 7 8 9 10 <Next>
    buttons or links at the bottom or top of the report so 50 records are displayed per page????

    Q2: Would it be possible to run queries directly inside pages using shortcode without the need to always create a report? Something similar to [sqlgetvar] but to return the full resultset.

    Q3: How to format a resultset as plain text and apply a custom CSS to it?

    Thanks very much for your feedback.

    Kind regards,
    George.

    https://wordpress.org/plugins/elisqlreports/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Eli

    (@scheeeli)

    A1: Currently there is no easy way to paginate a report. I have put this on my todo list but this project has been put on the back burner for now because of other more pressing demands on my time. If you would like to hack this feature into my plugin then I would be willing to consider adding your modifications to the next release 😉

    A2: That option wouldn’t actually be too hard at all to implement. Try replacing the ELISQLREPORTS_shortcode function with the code below, then you could wrap your SQL in the SQLREPORT shortcode:

    function ELISQLREPORTS_shortcode($attr, $SQL = “”) {
    $report = ”;
    if (isset($attr[‘style’]) && strlen(trim($attr[‘style’])))
    $GLOBALS[“ELISQLREPORTS”][“settings_array”][“default_styles”] = $attr[‘style’];
    if (isset($attr[‘name’]) && strlen(trim($attr[‘name’])))
    $report = ‘<div id=”‘.sanitize_title($attr[‘name’]).’-wrapper”><div id=”‘.sanitize_title($attr[‘name’]).’-parent”>’.ELISQLREPORTS_view_report($attr[‘name’]).'<br style=”clear: both;”></div></div>’;
    elseif (strlen(trim($SQL)))
    $report = ‘<div id=”SQL-‘.md5($SQL).’-wrapper”><div id=”SQL’.md5($SQL).’-parent”>’.ELISQLREPORTS_view_report(“”, $SQL).'<br style=”clear: both;”></div></div>’;
    return $report;
    }

    A3: The output is formatted in an HTML TABLE and wrapped in DIVs so that you can use CSS to style the results of your query how ever you want. I don’t see how plain text would be styled at all if it wasn’t wrapped in some kind of tags.

    What are all the CSS style names that you have implemented that we can use?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Report Pagination’ is closed to new replies.