Jump to content

Recommended Posts

Posted

Hello,

I have a scenario where I have 3 Accounts: A1, A2, and A3. A1 has 4 lines of data and A2 has 4 lines of data and A3 has 20 lines of data.

On the first page, A1 is printed with 4 lines of data and A2 is with 4 lines of data, and A3 with 10 lines of data, and the remaining 10 are printed on the second page. In this case, I have to print a text that says [Continued] when printing A3 is printed on the 2nd page. I have to print this text until the next account number is printed. Ex: A3 has 100 lines and data is printed on 10 pages then I have to print the [Continued] text in 9 pages.

This has to happen in detail band.

My data source is JSON. I have an array with all account numbers and a nested array of the line data.

Can anyone help me achieve this? Tis his an urgent request from the client.

Sample output:

In detail band: 

page1

A1

l1

l2

l3

l4

A2

l1

l2

l3

l4

A3

l1

l2

l3

l4

Page 2

A3[continued]

L5

l6

l7

etc

Thank you

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

Posted

It may be achieved by using '$V{Group1_COUNT} '.

'$V{Group1_COUNT} > 0' for the display condition of the "[continued]" item.


* Design Image
w20220729_design.png.c63a14f8a1b588506f4faa7670195a07.png

 

* Preview Image
w20220729_page1.png.338d66ce2c3e097f3df4edfb4fee7567.png
w20220729_page2.png.e10d0be32b3a8f8f324bc49ba365d374.png
w20220729_page3.png.565f5f7eff3616170216c2abce0922fc.png

 

 

 

Posted

I created a group for account_number and a variable automatically got created. But I don't see it in the variable list when I'm trying to write an expression.

Attached screenshots

Posted

I looked at your screen shot.
It looked like you were creating groups with 'sub-datasets(data)' instead of 'main dataset'.
My sample report is a simple example where only the 'main dataset' exists, so this seemed to be the difference between you and me.
I tried a little to get closer to your report, but I could not figure out how to use sub-datasets in the detail bands.
If you attach your jrmx file I might be able to look into it a bit more.

Posted

I don't think it is a good idea for you and I to communicate one-on-one, as it may not be helpful to other viewers of this community site.
Can you create a new, simple, publishable sample report that you can reproduce the event?
If that is very difficult, I will reply to the email you have sent to me and you can attach it to that email and reply again.

 

Posted

I have checked your jrxml and json files.

In conclusion, I unfortunately did not succeed in fulfilling your request.
I apologize for not being able to help you.

I will only share a hint to the solution.

The way you are making it now, the '$V{Group1_COUNT}' value does not return the expected value.

* Image of how it is made now
main-dataset
 └ sub-dataset(data) --> list1(3 items retrieved)
  └ sub-dataset(transaction) --> list2(67 cases retrieved [breakdown: Grp1=60 cases + Grp2=5 cases + Grp3=2 cases])

To get the value of '$V{Group1_COUNT}' as expected, it is necessary to get sub-dataset(data) and sub-dataset(transaction) together.

* Image of how to create after the change
main-dataset
 └ sub-dataset(data-transaction) --> list1+2 (67 items obtained [breakdown: Grp1=60 + Grp2=5 + Grp3=2])


sub-dataset(data-transaction) is based on sub-dataset(transaction) with the addition of 'account_desc' and 'account_total'.
One thing to note is that the language needs to be changed from 'JSON' to 'jsonql'.
The reason for this is that I need to write '^{2}.xxxxxx' in the expression to get the data one level up.
I have been successful up to the data preview on the dataset definition.

w20220806_data-transaction.thumb.png.8bff2e1409f046b75e9974aa275c8263.png
w20220806_data-transaction_datapreview.thumb.png.aa629637a6feaf2147f568aa37a41d2c.png

However, I could not use this sub-dataset(data-transaction) to display data in ListConpornent.
Since existing sub-dataset(data) and sub-dataset(transaction) are available, you can most likely solve this problem.

By the way, I created a simple report to investigate this solution.
To my surprise, it succeeds without difficulty when the source data is 'MySQL(RDMBS)', but fails when the source data is a 'JSON file'.
I am not used to dealing with 'JSON files', so I believe there is a solution, I just don't know about it.

 

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...