Jump to content

Add continue test when data overflows to next page


venky.sai1993

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

  • 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...