Invoice with supporting pages?
Invoice with supporting pages?
I am going to try my best to explain this...
For each record in a databand I need a page at the end. Let's say I have 50 invoice lines...
First n pages depending on whether or not they fit....
<databand>
record 1
record 2
record 3
record 4
record 5
.....
record 50
</databand>
New pages.....
<support for record 1>
<support for record 2>
....
<support for record 50>
And I need it to be conditional. I may not need the additional pages.
And the support pages are a subreport.
Basically, I need an invoice on the first n pages and if whoever is getting the invoice requires support I need to be able to add that support for each record to the end.
I tried adding two databands, one with the lines and various combinations of new page before/after and I end up with various weird looking results like the subreports spanning pages, the first one missing, the last one missing, the footer being printed in the header (not making that up) but nothing that even resembles what I need.
For each record in a databand I need a page at the end. Let's say I have 50 invoice lines...
First n pages depending on whether or not they fit....
<databand>
record 1
record 2
record 3
record 4
record 5
.....
record 50
</databand>
New pages.....
<support for record 1>
<support for record 2>
....
<support for record 50>
And I need it to be conditional. I may not need the additional pages.
And the support pages are a subreport.
Basically, I need an invoice on the first n pages and if whoever is getting the invoice requires support I need to be able to add that support for each record to the end.
I tried adding two databands, one with the lines and various combinations of new page before/after and I end up with various weird looking results like the subreports spanning pages, the first one missing, the last one missing, the footer being printed in the header (not making that up) but nothing that even resembles what I need.
Re: Invoice with supporting pages?
Okay, so I found out I can add a page and this does what I want.
The invoice portion gets data from a business object - and that works.
The second page has another databand that has the subreport in it.
That subreport was added from a file and that report requires two parameters.
When I add that I pick the subreport file and add the two parameters.
The name is the same as the name of the variables in the subreport and the expression points to the field in the business object.
The subreports don't display any data. I don't think it's even hitting the SQL server to get the data.
The variables are used in the SQL query that's in the subreport.
I don't know if I am doing this right either but I got a little further.
See attached.... what am I doing wrong?
The invoice portion gets data from a business object - and that works.
The second page has another databand that has the subreport in it.
That subreport was added from a file and that report requires two parameters.
When I add that I pick the subreport file and add the two parameters.
The name is the same as the name of the variables in the subreport and the expression points to the field in the business object.
The subreports don't display any data. I don't think it's even hitting the SQL server to get the data.
The variables are used in the SQL query that's in the subreport.
I don't know if I am doing this right either but I got a little further.
See attached.... what am I doing wrong?
- Attachments
-
- test.zip
- (2.99 KiB) Downloaded 202 times
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Invoice with supporting pages?
Hello,
To use Parameters in SubReports, you should use the expression:
{this["Var"]}
add a variable with the same name is not needed.
Thank you.
To use Parameters in SubReports, you should use the expression:
{this["Var"]}
add a variable with the same name is not needed.
Thank you.
Re: Invoice with supporting pages?
You have me at a loss.
The subreport needs the parameter.... so...?
Where does this line of code go then?
How does that populate the parameter in the subreport?
Is "Var" the name of the parameter in the suibreport?
I need a lot more context.
The subreport needs the parameter.... so...?
Where does this line of code go then?
How does that populate the parameter in the subreport?
Is "Var" the name of the parameter in the suibreport?
I need a lot more context.
Re: Invoice with supporting pages?
Ok, attached is an ENTIRE WORKSPACE that illustrates what I am trying to do.
Note that the subreport variables are indeed empty when you run it. I need those variables because in my real subreport they are passed to SQL.
These are very simplistic examples.
I need to know where and how those get passed in.... and remember, I don't know this like you chaps do so you have to tell me like, exactly where and how I get there.
Note that the subreport variables are indeed empty when you run it. I need those variables because in my real subreport they are passed to SQL.
These are very simplistic examples.
I need to know where and how those get passed in.... and remember, I don't know this like you chaps do so you have to tell me like, exactly where and how I get there.
- Attachments
-
- ReportFRomBusinessObject.zip
- (3.1 MiB) Downloaded 204 times
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Invoice with supporting pages?
Hello,
To use Parameters in SubReports, you should use the expression:
{this["ParameterName"]}
Thank you.
To use Parameters in SubReports, you should use the expression:
{this["ParameterName"]}
Thank you.
- Attachments
-
- Annotation 2019-01-03 150754.jpg (274.55 KiB) Viewed 3645 times
Re: Invoice with supporting pages?
But my subreport needs the variables to pass into it's SQL query?
Am I not able to do that?
My example didn't have the variables or the SQL query to keep it simple.
Am I not able to do that?
My example didn't have the variables or the SQL query to keep it simple.
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Invoice with supporting pages?
Hello,
You can use SubReport parameter in the query:
select * from Categories where CategoryID = {this["SubParam1"]}
Thank you.
You can use SubReport parameter in the query:
select * from Categories where CategoryID = {this["SubParam1"]}
Thank you.
- Attachments
-
- Annotation 2019-01-03 213243.jpg (227.03 KiB) Viewed 3642 times
Re: Invoice with supporting pages?
Ok, that worked.
Getting closer!
Here is my next issue. The subreport does run by itself as a regular report in other cases so I still need the variables.
The variables are assigned in the application.
I would like to keep using the variables because in the application I read the Name, Category,Alias, and Description values.
(these are GREAT! btw. Offtopic question: Can we extend these?)
I can work around this by using an IF in my where clause... like .... where GUID=IF( '{this["GUIDParam"]}' = '', @GUIDVar, '{this["GUIDParam"]}' )
Is there a better solution?
Otherwise, I think I am there.
Getting closer!
Here is my next issue. The subreport does run by itself as a regular report in other cases so I still need the variables.
The variables are assigned in the application.
I would like to keep using the variables because in the application I read the Name, Category,Alias, and Description values.
(these are GREAT! btw. Offtopic question: Can we extend these?)
I can work around this by using an IF in my where clause... like .... where GUID=IF( '{this["GUIDParam"]}' = '', @GUIDVar, '{this["GUIDParam"]}' )
Is there a better solution?
Otherwise, I think I am there.
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Invoice with supporting pages?
Hello,
Yes, you can add variable in SubReport and use the following query:
select * from Categories
where CategoryID = {(this["SubParam1"] == null ? Variable1 : this["SubParam1"])}
Thank you.
Yes, you can add variable in SubReport and use the following query:
select * from Categories
where CategoryID = {(this["SubParam1"] == null ? Variable1 : this["SubParam1"])}
Thank you.