How to create random dynamic 2D arrays in SystemVerilog?

In reply to Shubhabrata:

Your code still I got the same error message


 assert(pkt.randomize());
                     |
ncsim: *W,SVRNDF (./test1_packet.sv,54|21): The randomize method call failed.
Observed simulation time : 0 FS + 0
ncsim: *W,RNDOCS: These constraints contribute to the set of conflicting constraints:

    height  inside {[8:15]}; (./test1_packet.sv,38)
    foreach(data[i]) (./test1_packet.sv,40)
ncsim: *W,RNDOCS: These variables contribute to the set of conflicting constraints:

rand variables:
       height [./test1_packet.sv, 33]

ncsim: *E,ASRTST (./test1_packet.sv,54): (time 0 FS) Assertion test.unmblk1.__assert_1 has failed 

I also check the your code working well in the EDAPLAYGROUND.
I think this problem is in tool side.

Could you guide me any alternative way?