Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #1244100
Multiple reports with different variables on same page
Closed

Comments

  • Rafael started the conversation

    Hi,

    I would like to offer the possibility to download a specific report for every user of my webpage. To do so, I wrote some PHP code which fills the builder's shortcodes with the usernames and displays them all on the same page. 

    Unfortunately, when I download a report, it will always take the variables of the last shortcode. See picture for example. (In the picture, the variable "Mitarbeiter" will always be filled with "User 3", altough I would want it to insert "User 1" in the first row, "User 2" in the second and so on)

    Is there a way to avoid this?

    Thanks a lot.

    Rafael

  • [deleted] replied

    Hi Rafael,
    Thank you for the purchase.

    I didn't understand quite well how you populate "Mitarbeiter" fields? Dynamically with your PHP code or you set default values fro these inputs?

    Can you please send me a link of your page where you have report so I can take a look at it.

  • Rafael replied

    Hi Milos, I very primitively get a list of the users and then insert the data into the shortcodes:

    $month_ini = new DateTime("first day of last month");
    $month_end = new DateTime("last day of last month");

    $args = array(
    'blog_id'      => $GLOBALS['blog_id'],
    'role__in'     => array(Promoter, Berater, Administrator),
    'exclude'      => array(1,4,5),
    'orderby'      => 'ID',
    'order'        => 'ASC'
     );
    $users = get_users( $args );
    foreach( $users as $user ){
    echo '
    [reportbuilder id=1 element="varInput" name="Mitarbeiter" text="Mitarbeiter" default="' . $user->display_name . '" class=""]
    [reportbuilder id=1 element="varInput" name="Von (Datum dd.mm.jjjj)" text="Zeitspanne: Von " default="' . $month_ini->format('d.m.Y') . '" class=""]
    [reportbuilder id=1 element="varInput" name="Bis (Datum dd.mm.jjjj)" text="Bis " default="' . $month_end->format('d.m.Y') . '" class=""]
    [reportbuilder id=1 text="Bericht herunterladen" class="btn"]
    [wpdatatable id=5 var1="' . $user->display_name . '" var2="' . $month_ini->format('d.m.Y') . '" var3="' . $month_end->format('d.m.Y') . '"]<br>
    ';}

  •   Rafael replied privately
  • [deleted] replied

    Hi Rafael,

    Your website requires login and I can't see your page. Do you have problem with your custom code or problem is with generating reports?

  • Rafael replied

    Hi Milos,

    i solved the Problem by generating a personal page for every user and show user-specific content only.

    Thanks for your help