Crystal Reports Spring V9 "Make filter on map from the spring form"

Asked

Viewed 163 times

-2

[Crystal Reporter] [inserir a descrição da imagem aqui]1

I have this screen, I need to build a map that shows me the Monthly and Annual Analysis at the same time, but, from a query and not specific tables only that in this query I need a filter that is the year (2019) of the above Image.

How do I get the form 2019 insert into the map without using parameters? follows the query( the year (2019) needs to come from the form):

select *
from (

select a.rubrica, 
Jan=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=1 and year(dataac)=2019 ),0) ,
Fev=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=2 and year(dataac)=2019 ),0),
Marc=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=3 and year(dataac)=2019 ),0),
Abr=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=4 and year(dataac)=2019 ),0),
Mai=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=5 and year(dataac)=2019 ),0),
Jun=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=6 and year(dataac)=2019 ),0),
Jul=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=7 and year(dataac)=2019 ),0),
Ago=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=8 and year(dataac)=2019 ),0),
Sept=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=9 and year(dataac)=2019 ),0),
Outb=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=10 and year(dataac)=2019 ),0),
Nov=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=11 and year(dataac)=2019 ),0),
Dez=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=12 and year(dataac)=2019 ),0) 
from AcRubricas a where year(a.DataAc)=2019  group by a.Rubrica) mensal
inner join
(select rubrica,sum(Acum) as Acumulado,sum(orca) as Orcamento,( sum(orca) - sum(Acum)) as desvio from AcRubricas where  year(DataAc)=2019 group by rubrica) anual on anual.rubrica = mensal.Rubrica

1 answer

0

I would say that the simplest is to create a view based on this query, removing the filter by Year and grouping the data by Year. Then create a new map based on the existing one. You add your View to the map, you can link to the existing table, for example by Rubric, thus having the filter of selected rubrics in the window. Inside this map you have a field "Year" ("formula field"), which is passed by Spring. Use this field to filter the data to be presented.

  • I have often had problems filtering the data to present and avoid using because when making the sum use all the data until the not shown. obgdo by suggestion. I realized that I have no chance without the parameters is this? I made a new map and I’m having another error. error follows:"This field name is not known. Details: errorKind Error in BALS01 {5B2E11DD-6324-4390-8E03-157B7850BFA2}. rpt: Record Selection: '{Accumulationsrubrics.posto}=1' This field name is not known. Details: errorKind"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.