新手入门,看了不少官方教材,但是还是不太懂主从表设计。还请前辈指导。目前报表文件内容如下:
{"Name":"123","Width":"21.007cm","Layers":[{"Name":"default"}],"CustomProperties":[{"Name":"DisplayType","Value":"Page"},{"Name":"SizeType","Value":"Default"},{"Name":"PaperOrientation","Value":"Portrait"}],"Page":{"PageWidth":"8.5in","PageHeight":"11in","RightMargin":"0in","LeftMargin":"0in","TopMargin":"0in","BottomMargin":"0in","Columns":1,"ColumnSpacing":"0.5in"},"DataSources":[{"Name":"t_sys_user_detailoneViewConfig","ConnectionProperties":{"DataProvider":"JSONEMBED","ConnectString":"jsondata=[\\n { \"detailone\": \"546\", \"user_id\": null, \"detailtwo\": \"456\", \"detailthree\": \"456\", \"detailfour\": \"456\", \"Modelt_sys_user_detailtwos\": [{ \"t_sys_user_detailone_id\": \"3cfaaf08-17e4-4f59-af2e-fa58f492e35f\", \"detailone\": \"123\", \"detailtwo\": \"123\", \"detailthree\": \"123\", \"detailfour\": \"123\", \"id\": \"0ef4f63b-8e33-4dfa-a303-7bae7816a063\", \"created_time\": \"2023-01-03T13:41:51.523\", \"created_by\": \"0bedb4d3-bb91-4830-a3f7-8f9a961089b1\" }], \"id\": \"3cfaaf08-17e4-4f59-af2e-fa58f492e35f\", \"created_time\": \"2022-12-31T16:58:12.647\", \"created_by\": null },\\n { \"detailone\": \"1231\", \"user_id\": null, \"detailtwo\": \"1231\", \"detailthree\": \"1231\", \"detailfour\": \"1231\", \"Modelt_sys_user_detailtwos\": [], \"id\": \"e3f83a5e-9919-4c41-a75b-422f37d1f4bd\", \"created_time\": \"2023-01-05T09:44:54.87\", \"created_by\": \"0bedb4d3-bb91-4830-a3f7-8f9a961089b1\" }, \\n { \"detailone\": \"123\", \"user_id\": null, \"detailtwo\": \"123\", \"detailthree\": \"123\", \"detailfour\": \"123\", \"Modelt_sys_user_detailtwos\": [], \"id\": \"521556cb-143e-4392-8adf-574723764166\", \"created_time\": \"2022-12-31T16:39:32.687\", \"created_by\": null }, { \"detailone\": \"123\", \"user_id\": null, \"detailtwo\": \"123\", \"detailthree\": \"123\", \"detailfour\": \"123\", \"Modelt_sys_user_detailtwos\": [], \"id\": \"e9307b21-16d4-4d14-9c88-783b1b41a6fb\", \"created_time\": \"2022-12-30T17:50:23.107\", \"created_by\": null }, \\n { \"detailone\": \"444\", \"user_id\": null, \"detailtwo\": \"44\", \"detailthree\": \"444\", \"detailfour\": \"44\", \"Modelt_sys_user_detailtwos\": [], \"id\": \"71bddbcd-6a57-4483-8a62-ed59e5f55591\", \"created_time\": \"2022-12-30T17:47:26.92\", \"created_by\": null }, { \"detailone\": \"123\", \"user_id\": null, \"detailtwo\": \"123\", \"detailthree\": \"123\", \"detailfour\": \"1233\", \"Modelt_sys_user_detailtwos\": [], \"id\": \"572118cd-cd43-4f82-a8ce-043672371006\", \"created_time\": \"2022-12-30T17:42:22.35\", \"created_by\": null }, \\n { \"detailone\": \"qwe1\", \"user_id\": \"qwe\", \"detailtwo\": \"qwe1\", \"detailthree\": \"qwe1\", \"detailfour\": \"qwe1\", \"Modelt_sys_user_detailtwos\": [], \"id\": \"59bcc555-820f-42d8-902f-879035639a3e\", \"created_time\": \"2022-12-10T18:11:18.513\", \"created_by\": \"0bedb4d3-bb91-4830-a3f7-8f9a961089b1\" }, { \"detailone\": \"asd\", \"user_id\": \"asd\", \"detailtwo\": \"asd\", \"detailthree\": \"asd\", \"detailfour\": \"asd\", \"Modelt_sys_user_detailtwos\": [], \"id\": \"e8d9a69d-9338-45b9-a6d8-8c6b110a2d1f\", \"created_time\": \"2022-12-10T18:09:25.85\", \"created_by\": \"0bedb4d3-bb91-4830-a3f7-8f9a961089b1\" }, \\n { \"detailone\": \"123\", \"user_id\": \"123\", \"detailtwo\": \"123\", \"detailthree\": \"123\", \"detailfour\": \"123\", \"Modelt_sys_user_detailtwos\": [{ \"t_sys_user_detailone_id\": \"cfe511a2-c9d7-40a7-8883-2b9279243e0e\", \"detailone\": \"3123\", \"detailtwo\": \"123\", \"detailthree\": \"123\", \"detailfour\": \"123\", \"id\": \"0248d0c2-d6ca-4db7-9be2-b7b350560f18\", \"created_time\": \"2022-12-30T22:13:22.297\", \"created_by\": null }], \"id\": \"cfe511a2-c9d7-40a7-8883-2b9279243e0e\", \"created_time\": \"2022-12-04T11:08:34.333\", \"created_by\": \"2252f957-f34d-4e9a-952e-48e57bd215fa\" }, \\n { \"detailone\": \"323\", \"user_id\": \"232\", \"detailtwo\": \"323\", \"detailthree\": \"2323\", \"detailfour\": \"23\", \"Modelt_sys_user_detailtwos\": [{ \"t_sys_user_detailone_id\": \"e7d44187-a210-45e5-bd2f-0fe7551db800\", \"detailone\": \"·12\", \"detailtwo\": null, \"detailthree\": \"123 \", \"detailfour\": \"123\", \"id\": \"354e3f03-72e3-4bfc-8a7b-ffbc53a42330\", \"created_time\": \"2022-12-03T08:08:47.003\", \"created_by\": \"2252f957-f34d-4e9a-952e-48e57bd215fa\" }, { \"t_sys_user_detailone_id\": \"e7d44187-a210-45e5-bd2f-0fe7551db800\", \"detailone\": \"1\", \"detailtwo\": \"1\", \"detailthree\": \"1\", \"detailfour\": \"1\", \"id\": \"4d4ea196-9321-4780-9cc9-6a88dc9a0156\", \"created_time\": \"2022-12-03T08:10:19.207\", \"created_by\": \"2252f957-f34d-4e9a-952e-48e57bd215fa\" }], \"id\": \"e7d44187-a210-45e5-bd2f-0fe7551db800\", \"created_time\": \"2022-11-27T11:42:30.6\", \"created_by\": \"2252f957-f34d-4e9a-952e-48e57bd215fa\" }, \\n { \"detailone\": \"2\", \"user_id\": \"2252f957-f34d-4e9a-952e-48e57bd215fa\", \"detailtwo\": \"2\", \"detailthree\": \"2\", \"detailfour\": \"3\", \"Modelt_sys_user_detailtwos\": [{ \"t_sys_user_detailone_id\": \"f9bee7aa-ba31-485c-ba7b-3cf3d4b109b3\", \"detailone\": \"321\", \"detailtwo\": \"321\", \"detailthree\": \"312\", \"detailfour\": \"321\", \"id\": \"8e76a2c2-bf3e-4908-af10-8d02f1ab936e\", \"created_time\": \"2022-12-04T11:08:49.19\", \"created_by\": \"2252f957-f34d-4e9a-952e-48e57bd215fa\" }], \"id\": \"f9bee7aa-ba31-485c-ba7b-3cf3d4b109b3\", \"created_time\": \"2022-11-17T11:27:24.17\", \"created_by\": null }, { \"detailone\": \"1\", \"user_id\": \"12\", \"detailtwo\": \"21\", \"detailthree\": \"12\", \"detailfour\": \"12\", \"Modelt_sys_user_detailtwos\": [{ \"t_sys_user_detailone_id\": \"163f45ca-5cb6-4a75-9f7d-8500f2c54fe0\", \"detailone\": \"123\", \"detailtwo\": \"123\", \"detailthree\": \"123\", \"detailfour\": \"123\", \"id\": \"a8e9e03b-0eda-45e2-a3cc-155d2c4ec2de\", \"created_time\": \"2022-12-04T11:08:43.04\", \"created_by\": \"2252f957-f34d-4e9a-952e-48e57bd215fa\" }], \"id\": \"163f45ca-5cb6-4a75-9f7d-8500f2c54fe0\", \"created_time\": \"2022-11-17T11:16:04.143\", \"created_by\": null }, \\n { \"detailone\": \"1\", \"user_id\": \"1\", \"detailtwo\": \"1\", \"detailthree\": \"1\", \"detailfour\": \"1\", \"Modelt_sys_user_detailtwos\": [{ \"t_sys_user_detailone_id\": \"1\", \"detailone\": \"321\", \"detailtwo\": \"321\", \"detailthree\": \"321\", \"detailfour\": \"321\", \"id\": \"c8c6d2ab-9eea-4621-9a05-8ab5b9b759a4\", \"created_time\": \"2022-12-04T11:09:08.713\", \"created_by\": \"2252f957-f34d-4e9a-952e-48e57bd215fa\" }], \"id\": \"1\", \"created_time\": null, \"created_by\": null }]"}}],"Body":{"Height":"10cm","ReportItems":[{"Type":"table","Name":"表格1","DataSetName":"t_sys_user_detailone","TableColumns":[{"Width":"10.001cm"},{"Width":"10.004cm"}],"Header":{"TableRows":[{"Height":"0.75cm","TableCells":[{"Item":{"Type":"textbox","Name":"文本框1","DataElementName":"TextBox1","CanGrow":true,"KeepTogether":true,"Value":"detailone","Style":{"PaddingLeft":"2pt","PaddingRight":"2pt","PaddingTop":"2pt","PaddingBottom":"2pt"},"Left":"0cm","Top":"0cm","Width":"10.001cm","Height":"0.75cm"}},{"Item":{"Type":"textbox","Name":"文本框2","DataElementName":"TextBox1","CanGrow":true,"KeepTogether":true,"Value":"id","Style":{"PaddingLeft":"2pt","PaddingRight":"2pt","PaddingTop":"2pt","PaddingBottom":"2pt"},"Left":"0cm","Top":"0cm","Width":"10.004cm","Height":"0.75cm"}}]}],"RepeatOnNewPage":true},"Details":{"TableRows":[{"Height":"0.75cm","TableCells":[{"Item":{"Type":"textbox","Name":"文本框3","DataElementName":"detailone","CanGrow":true,"KeepTogether":true,"Value":"=Fields!detailone.Value","Style":{"PaddingLeft":"2pt","PaddingRight":"2pt","PaddingTop":"2pt","PaddingBottom":"2pt"},"Left":"0cm","Top":"0cm","Width":"10.001cm","Height":"0.75cm"}},{"Item":{"Type":"textbox","Name":"文本框4","DataElementName":"id","CanGrow":true,"KeepTogether":true,"Value":"=Fields!id.Value","Style":{"PaddingLeft":"2pt","PaddingRight":"2pt","PaddingTop":"2pt","PaddingBottom":"2pt"},"Left":"0cm","Top":"0cm","Width":"10.004cm","Height":"0.75cm"}}]}]},"Left":"1cm","Top":"2.5cm","Width":"20.005cm","Height":"1.5cm"},{"Type":"table","Name":"表格2","ZIndex":1,"DataSetName":"Modelt_sys_user_detailtwos","TableColumns":[{"Width":"10.001cm"},{"Width":"10.006cm"}],"Header":{"TableRows":[{"Height":"0.75cm","TableCells":[{"Item":{"Type":"textbox","Name":"文本框5","DataElementName":"TextBox1","CanGrow":true,"KeepTogether":true,"Value":"id","Style":{"PaddingLeft":"2pt","PaddingRight":"2pt","PaddingTop":"2pt","PaddingBottom":"2pt"},"Left":"0cm","Top":"0cm","Width":"10.001cm","Height":"0.75cm"}},{"Item":{"Type":"textbox","Name":"文本框6","DataElementName":"TextBox1","CanGrow":true,"KeepTogether":true,"Value":"t_sys_user_detailone_id","Style":{"PaddingLeft":"2pt","PaddingRight":"2pt","PaddingTop":"2pt","PaddingBottom":"2pt"},"Left":"0cm","Top":"0cm","Width":"10.006cm","Height":"0.75cm"}}]}],"RepeatOnNewPage":true},"Details":{"TableRows":[{"Height":"0.75cm","TableCells":[{"Item":{"Type":"textbox","Name":"文本框7","DataElementName":"t_sys_user_detailone_id","CanGrow":true,"KeepTogether":true,"Value":"=Fields!id.Value & \" \"","Style":{"PaddingLeft":"2pt","PaddingRight":"2pt","PaddingTop":"2pt","PaddingBottom":"2pt"},"Left":"0cm","Top":"0cm","Width":"10.001cm","Height":"0.75cm"}},{"Item":{"Type":"textbox","Name":"文本框8","DataElementName":"id","CanGrow":true,"KeepTogether":true,"Value":"=Fields!t_sys_user_detailone_id.Value","Style":{"PaddingLeft":"2pt","PaddingRight":"2pt","PaddingTop":"2pt","PaddingBottom":"2pt"},"Left":"0cm","Top":"0cm","Width":"10.006cm","Height":"0.75cm"}}]}]},"Left":"1cm","Top":"8.5cm","Width":"20.007cm","Height":"1.5cm"}]},"DataSets":[{"Name":"t_sys_user_detailone","Fields":[{"Name":"detailone","DataField":"detailone"},{"Name":"user_id","DataField":"user_id"},{"Name":"detailtwo","DataField":"detailtwo"},{"Name":"detailthree","DataField":"detailthree"},{"Name":"detailfour","DataField":"detailfour"},{"Name":"Modelt_sys_user_detailtwos","DataField":"Modelt_sys_user_detailtwos"},{"Name":"id","DataField":"id"},{"Name":"created_time","DataField":"created_time"},{"Name":"created_by","DataField":"created_by"}],"Query":{"DataSourceName":"t_sys_user_detailoneViewConfig","CommandText":"jpath=$.*"},"CaseSensitivity":"Auto","KanatypeSensitivity":"Auto","AccentSensitivity":"Auto","WidthSensitivity":"Auto"},{"Name":"Modelt_sys_user_detailtwos","Fields":[{"Name":"t_sys_user_detailone_id","DataField":"t_sys_user_detailone_id"},{"Name":"detailone","DataField":"detailone"},{"Name":"detailtwo","DataField":"detailtwo"},{"Name":"detailthree","DataField":"detailthree"},{"Name":"detailfour","DataField":"detailfour"},{"Name":"id","DataField":"id"},{"Name":"created_time","DataField":"created_time"},{"Name":"created_by","DataField":"created_by"}],"Query":{"DataSourceName":"$dataset:t_sys_user_detailone/Modelt_sys_user_detailtwos"},"CaseSensitivity":"Auto","KanatypeSensitivity":"Auto","AccentSensitivity":"Auto","WidthSensitivity":"Auto"}]}
返回的数据已经处理好主从关系。不知道怎么设置报表的时候,主从分隔显示呢?因为我看到加载这个数据源的时候默认就显示2个数据集,但是拖过去显示的时候就默认显示全部。不知道怎么设置过滤,能够一条主数据,然后显示子数据,再显示下一条主数据这样的分隔显示呢?
|