Recent

Author Topic: [solved] lazreport display separated dataset in a single band  (Read 3968 times)

kito

  • New Member
  • *
  • Posts: 10
hello ,
I am newbie I wish that I could  make my question as clear as possible .
I have a principle dataset let's name it  'years' contains all years and salary-field
I used 03 queries  with where clauses to separate  it  to three new DS :
...
year_A   /  salary ..................... year_B   /  salary ......................year_C  /  salary
...
2005     /   400     ..................... 2006     /   400    ......................2007     /   400   
2005     /   400     ..................... 2006     /   250    ......................2007     /   420 
2005     /   400     ..................... 2006     /   400    ......................2007     /   580
2005     /   400     ..................... 2006     /   400    ......................2007     /   315 

I want to display the three tables (with lazreport ) in single band  at least with the same vertical alignment position . please  any hints ?

Thanks

* each dataset has the same record count
*I had attached a pic
« Last Edit: April 02, 2016, 08:01:08 pm by kito »

cpalx

  • Hero Member
  • *****
  • Posts: 619
Re: lazreport display separated dataset in sigle band
« Reply #1 on: March 30, 2016, 02:28:13 pm »
Make a store procedure that display the data as you want, then you will have just one query and you wont have problems

alexs75

  • Full Member
  • ***
  • Posts: 104
Re: lazreport display separated dataset in sigle band
« Reply #2 on: March 30, 2016, 08:59:30 pm »
Use subreports

kito

  • New Member
  • *
  • Posts: 10
Re: lazreport display separated dataset in sigle band
« Reply #3 on: March 31, 2016, 09:05:20 pm »
Make a store procedure that display the data as you want, then you will have just one query and you wont have problems
Thank you cpalx for your replay , your solution sounds effective , I spent last days googling how to apply that on similar situation as mine .
I only get lucky  with  separation of the years but   salary  lost their place  and just keeping duplicated from as the  first row .

my producer Now looks like this :

Quote
CREATE  PROCEDURE TRY
(
  IPIC_Y    INTEGER
)

RETURNS (
  COUNTY2    INTEGER,
  SALARY2    INTEGER
)

AS
declare variable i integer;

BEGIN
i=0 ;
while (i < 4) do
     for select YEAR_BRY,somme
     from BRY where bry.YEAR_BRY = :ipic_y
 
     into :county2,SALARY2
     
 
  Do
  begin
  --county = :ipic_y ;
  county2 = :ipic_y + i ;
 
  i=i+1;
  SUSPEND;
  end
  end;                     
« Last Edit: March 31, 2016, 09:07:07 pm by kito »

kito

  • New Member
  • *
  • Posts: 10
Re: lazreport display separated dataset in sigle band
« Reply #4 on: March 31, 2016, 09:08:53 pm »
Use subreports
thank you alexs75  I am keeping an eye on your suggestion ,  .

kito

  • New Member
  • *
  • Posts: 10
Re: lazreport display separated dataset in a single band
« Reply #5 on: April 02, 2016, 07:40:34 pm »
well , it's too complicated , and first of all it needs time to understand the problematic , it doesn't belong to lazreport section according to the previews answers . what I need is : taking a deep look at the stored producers , PIVOT tables.
 
I'll mark it as solved , and perhaps if it's allowed I'll leave a comment later  if I figure out how to fix it .

kito

  • New Member
  • *
  • Posts: 10
Re: [solved] lazreport display separated dataset in a single band
« Reply #6 on: April 04, 2016, 01:05:04 am »
It took another hint from a friend of mine   :-[

first (optionally) generate a stored producer from this query  :

Quote
Select (case year When : year  Then Salary  Else null END) Year1,(case year When :year +1  Then Salary  Else null END) Year2,(case year When :year + 2 Then Salary  Else null END) Year3 from My_table

the second part is depend on script inside the report  ( value = null  ---> visible  =false )

yep My face was like that   :o 



* tested on Firebird /Oracle