pyreportjasper icon indicating copy to clipboard operation
pyreportjasper copied to clipboard

Pass array as a parameter

Open ewu-tarun opened this issue 2 years ago • 2 comments

Is there any way to pass array to the parameter objects?

Suppose I have dynamic JSON like

 temp = {
        "name": "test",
        "contacts": {
            "person": [
                {
                    "name": "ETHAN",
                    "street": "Street 1",
                    "city": "Fairfax",
                    "phone": "+1 (415) 111-1111"
                },
                {
                    "name": "CALEB",
                    "street": "Street 2",
                    "city": "San Francisco",
                    "phone": "+1 (415) 222-2222"
                },
                {
                    "name": "WILLIAM",
                    "street": "Street 2",
                    "city": "Paradise City",
                    "phone": "+1 (415) 333-3333"
                }
            ]
        }
    }

so i want to pass this json as a parameter. how to do this?

ewu-tarun avatar Mar 10 '22 05:03 ewu-tarun

@jadsonbr could you please give me a suggestions?

ewu-tarun avatar Mar 10 '22 06:03 ewu-tarun

Shouldn't this be a datasource?

jadsonbr avatar Jul 09 '22 16:07 jadsonbr

Shouldn't this be a datasource?

Probably on this case, but it has not to be. Jasper allows collections parameters, but even passing an array of int primitives to params gives Error fill report: No matching overloads found for java.util.HashMap.put(str,list)

hypnotic-frog avatar Oct 30 '22 16:10 hypnotic-frog

Currently, data sent as parameters to the report must be of type string and converted to their appropriate types within the report. It is possible to send the correct type but you will have to do this using the jpype library to interpret the correct type within python to be sent to the java library

JPype types

jadsonbr avatar Nov 18 '22 12:11 jadsonbr

Closed due to lack of interaction.

jadsonbr avatar Dec 29 '23 11:12 jadsonbr