Page number and line number in data source

Stimulsoft Reports.WPF discussion
Post Reply
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Page number and line number in data source

Post by Niqu »

Hello.

I am a bit confuse, becouse i thought it will not have problems with it, but i do.
I want to do two things.

First:
I want have page number on page when number of page is greater than 1. I tried using system variables, but all failed. I used conditions like "TotalPageCount == 1", "TotalPageCount > 1", "IsFirstPage == IsLastPage", "IsFirstPage == true && IsLastPage == true" - when i was displaying values of this variables, they were correct, but conditions didn't work. I add attachment to show it. Maybe i am doing something wrong - on 90% i am doing something wrong, becouse it should work, but i am not sure what unfortunately.

Second:
I have three data source with the same business obcjet and they display similar field, but in different place of report and the data i want to display in each data source is different. I have field name "Type" (it is int) and when the value of this field is 0 i want to display it in first data source, if the value is 1 i want to display it in second data source, etc. I tried using filter, but it didn't work, becouse all data sources take the last added filter, not their own filter. So i used conditions on all fields and it work as i wanted (but still don't know why filters didn't work). And now i also want to display line in each data source starting from 1. I was trying using system variables Line and LineThrough and GroupLine, but it never work fine.

Do you have any idea how to fix this two problems?

Thank you in advance.
Attachments
Report_PageN.mrt
(4.71 KiB) Downloaded 500 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Page number and line number in data source

Post by HighAley »

Hello.
Niqu wrote:I want have page number on page when number of page is greater than 1. I tried using system variables, but all failed. I used conditions like "TotalPageCount == 1", "TotalPageCount > 1", "IsFirstPage == IsLastPage", "IsFirstPage == true && IsLastPage == true" - when i was displaying values of this variables, they were correct, but conditions didn't work. I add attachment to show it. Maybe i am doing something wrong - on 90% i am doing something wrong, becouse it should work, but i am not sure what unfortunately.
Please, try to set the Print On property.
Niqu wrote:I have three data source with the same business obcjet and they display similar field, but in different place of report and the data i want to display in each data source is different. I have field name "Type" (it is int) and when the value of this field is 0 i want to display it in first data source, if the value is 1 i want to display it in second data source, etc. I tried using filter, but it didn't work, becouse all data sources take the last added filter, not their own filter. So i used conditions on all fields and it work as i wanted (but still don't know why filters didn't work). And now i also want to display line in each data source starting from 1. I was trying using system variables Line and LineThrough and GroupLine, but it never work fine.
We didn't get where do you set filter.
Could you send us your report template with data for analysis.

Thank you.
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Page number and line number in data source

Post by Niqu »

Aleksey Andreyanov wrote: Please, try to set the Print On property.
Sorry, but i am a bit confuse now. Can you explain a bit more?
I have set Print On property to All Pages, becouse i want to print it on all pages if TotalPageCount is greater than 1, and i don't want to print it on any pages if TotalPageCount is equal 1.
I open new report with only one page (so TotalPageCount was equal 1 - i display it to check) and did two if:
1. {IIF(TotalPageCount == 1,
"It work",
"It do not work")}
2. {IIF(ToWords(TotalPageCount) == "1",
"It work",
"It do not work")}
both return "It do not work".

About the second problem i will try to make report with some data and i will send it to you.

Edit:
I add attachments to simply project, if it is not a problem.
This report is similar to my report, so i think fixing it also will fix problems in my report. Propobly i did something wrong, but at the moment i dont have any idea how to do it correct.
In business object is 12 rows. 4 rows has type 0, 4 rows has type 1, 4 rows has type 2. Each row with different type are in different data source. I think first data source work fine, but rest no much - as you can see i put data in Conditions (when i put filter "Users.Type == 1" and "Users.Type == 2" on this data source, both show me data with type 2). It propobly is the reason why Line do not show in case of 1,2,3,4 dispaly 2,5,8,11 and 3,6,9,12.
I hope you will understand what i want to achive.

Thank you in advance.
Attachments
StimulsoftWpfApplication.zip
(1.69 MiB) Downloaded 528 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Page number and line number in data source

Post by HighAley »

Hello.
Niqu wrote:Sorry, but i am a bit confuse now. Can you explain a bit more?
I have set Print On property to All Pages, becouse i want to print it on all pages if TotalPageCount is greater than 1, and i don't want to print it on any pages if TotalPageCount is equal 1.
I open new report with only one page (so TotalPageCount was equal 1 - i display it to check) and did two if:
1. {IIF(TotalPageCount == 1,
"It work",
"It do not work")}
2. {IIF(ToWords(TotalPageCount) == "1",
"It work",
"It do not work")}
both return "It do not work".
It's impossible to findout the final amount of pages at the rendering time. When the page number text component is rendering on the first page there is only one rendered page at all and it's unknown whether will be another page.
Please try to use your first condition "TotalPageCount == 1" and set the Number of Pass property of the report to Double Pass.
Niqu wrote:About the second problem i will try to make report with some data and i will send it to you.

Edit:
I add attachments to simply project, if it is not a problem.
This report is similar to my report, so i think fixing it also will fix problems in my report. Propobly i did something wrong, but at the moment i dont have any idea how to do it correct.
In business object is 12 rows. 4 rows has type 0, 4 rows has type 1, 4 rows has type 2. Each row with different type are in different data source. I think first data source work fine, but rest no much - as you can see i put data in Conditions (when i put filter "Users.Type == 1" and "Users.Type == 2" on this data source, both show me data with type 2). It propobly is the reason why Line do not show in case of 1,2,3,4 dispaly 2,5,8,11 and 3,6,9,12.
I hope you will understand what i want to achive.
You sample report is rendered right. I set the condition on the each text component but it better to set it on the band. The Line variable shows the current band number and it shows right value because other bands are shrunk.

Thank you.
Attachments
Report.mdc
(52.71 KiB) Downloaded 460 times
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Page number and line number in data source

Post by Niqu »

Aleksey Andreyanov wrote: You sample report is rendered right. I set the condition on the each text component but it better to set it on the band. The Line variable shows the current band number and it shows right value because other bands are shrunk.
Oh, I know it is rendered right. Your program work very good I just do not know how to do some things and it is the reason why i am asking.
I understand what you're saying, but it does not solve my problem. I want to show the number of each display row (except those not displayed), as it is done in the first data source where I used a filter. The use of the conditions is not entirely good, because as you said variable Line is also increased by the not displayed lines - the result is that instead of numbers 1,2,3, ... I got 2,5,8, ... (or something similar). So is it possible to get what i want by changing something or do something otherwise?


Edit: When I set the Number of Pass property of the report to Double Pass, it works as i wanted. Thank you for help.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Page number and line number in data source

Post by HighAley »

Hello.
Niqu wrote:Oh, I know it is rendered right. Your program work very good I just do not know how to do some things and it is the reason why i am asking.
I understand what you're saying, but it does not solve my problem. I want to show the number of each display row (except those not displayed), as it is done in the first data source where I used a filter. The use of the conditions is not entirely good, because as you said variable Line is also increased by the not displayed lines - the result is that instead of numbers 1,2,3, ... I got 2,5,8, ... (or something similar). So is it possible to get what i want by changing something or do something otherwise?


Edit: When I set the Number of Pass property of the report to Double Pass, it works as i wanted. Thank you for help.
As I wrote before you should use Filter property of the Data Band but not the Condition of the Text Components.
There is still not full support of business objects, but we working on it and solving all customers problems.
Due to temporary problem with business objects if you use the same BO in different Data Band it's necessary to add next string to Begin Render event on the each Data Band.

Code: Select all

Users.OwnerBand = DataBand1;
Please, look at the attached report template.
Report_modified.mrt
(35.02 KiB) Downloaded 553 times
Thank you.
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Page number and line number in data source

Post by Niqu »

This is what i needed. Everything works good. Thank you for help.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Page number and line number in data source

Post by HighAley »

Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.
Post Reply