We need to create dynamic json instead of static json to create reports pdf with server side PHP.

68 views
Skip to first unread message

Technology Shouters

unread,
Mar 18, 2019, 1:03:20 PM3/18/19
to ReportBro
Hello Report Bro,

Thank you so much for useful library and demos to use an open source drag and drop building tools.

We need to create dynamic json instead of static json to create reports pdf with server side PHP.

Problem what i have facing with element types & drag drop:

=> I need to create different element types in dynamic json of each form & fields and i am unable to create dynamic json same as static json. Because we have various forms and each forms has its fields as i can say children.

if I am creating dynamic within loop so unable to create multiple element type and associated objects :

for ($i = 0; $i < count($results); $i++) {
            $results[$i]["elementType"] = "text";
            $results [$i]["containerId"] = "0_content";
    $results [$i]["x"] =  250;
            $results [$i]["y"] = $i * 15 + 100;
        }

I checked with different element type table, frame, section it's not working with fields. if I am using element type "text" it's working but i am unable to put it's children's if element type is text.

=> I am unable to drag and drop left fields directly to report building section.


Hope I will get my answers from here.

Thank you
Krishna

al...@jobsta.at

unread,
Mar 18, 2019, 2:49:05 PM3/18/19
to ReportBro
Hello Krishna,

when you're dynamically creating elements make sure that all relevant properties are set. You need at least an id (must be a unique number) for each element. I don't know if something else is missing since we have not tried this out. In case it is not enough you should try to set all properties to be on the safe side.

Alex

Technology Shouters

unread,
Mar 19, 2019, 6:02:29 AM3/19/19
to ReportBro
Thank you Alex. I have tried with all properties but problem what i am facing with element type. In dynamic json within loop i am unable to set different element type for different fields and parent field.

I want for different forms will have several fields so i can drag those fields to the right side into report builder. Unfortunately i am not able to drag and drop fields to the right side as well.

I hope you are getting what exactly i am looking for. Any help & suggestions will be appreciated.

Thank you,
Krishna

al...@jobsta.at

unread,
Mar 22, 2019, 5:17:45 PM3/22/19
to ReportBro
Do you get any javascript errors? I'd recommend to create the report in ReportBro Designer and then compare the report definition json output with the json you're generating. Otherwise it will be difficult to find out what is missing or not correct. Other element types like sections require more work to create them dynamically - a section has section bands linked by parentId and other elements are placed inside the band and not the section element.
Reply all
Reply to author
Forward
0 new messages