Record selection issue in cross tab.
Hello!
I have a record filtering problem. I tried many scenarios, and searched this forum but I cannot find an solution.
I have a sub-report that contains a cross tab that provides a few summarized fields.
I have two tables: a table with category of events : (field catID and Catname) and an event table with a CatID, a date field and others number field I use in the cross tab.
I want my cross tab to show one row per category. The Catname and the summaries.
Now all is working fine but for one issue. I need to select my event according to a time bracket.
So I created two time parameters (start and end) and select the event dates between these two dates.
Now, when selected, any category that does not have an event between these dates are not displayed. I would like them to be shown with "o" values.
There must be a way of doing this. I just cannot find it.
Esther
In order for Crystal to show data, it must be given data to show!
You will need to base your subreport on an SQL Command. In that command, put the current SQL used by the report. To this, do a UNION to a select that selects the category name, and a zero for each field that you are summing in the crosstab.
As a simplified example, suppose the original SQL was (MS SQL):
select c.catname, sum(e.quantity) as Quantity
from categories c, events e
where c.catid = {?catid parm}
and c.catid = e.catid
and e.date between {?start} and {?end}
This would be changed to
select c.catname, sum(e.quantity) as Quantity
from categories c, events e
where c.catid = {?catid parm}
and c.catid = e.catid
and e.date between {?start} and {?end}
UNION
select c.catname, 0 as Quantity
from categories c
where c.catid = {?catid parm}
This will return an additional zero record, regardless of what data the original query returns, thus giving Crystal the data needed to display. Note that the zero value will not affect the results in any way, except causing a zero to be displayed if no data is returned from the original query.
Just remember that the second SELECT in the UNION has to have the same number of fields, of the same data type, as the first SELECT.
HTH,
Carl
Similar Messages
-
Issues with cross tabs when trying to convert our cry10 reports to cry 2008
We are trying to convert our reports from crystal 10 to crystal 2008. Reports that contain cross tabs will not execute in crystal 2008. We are getting a report application failed error. Has anyone encountered this? What is the fix?
I did notice that in a formula I am using in the Summarized Fields section I have a Next() on a field that I am trying to compare the next record with the current record. If I take that Next() out, the cross tab will work. Why would using this cause me problems?
-
I have the following record selection formula:
not ({TransDetailCustomerView.Route} in [199, 299, 399, 499, 599, 699, 799]) and
(not HasValue({?SUPPLIER}) OR {TransDetailCustomerView.VendorNo} = {?SUPPLIER}) and
not {TransDetailCustomerView.VoidFlag} and
{TransDetailCustomerView.InvoiceDate} = {?DATE RANGE} and
{TransDetailCustomerView.ChainCode} <> 395 and
(if {?LOCATION}= "ALL LOCATIONS" then TRUE
else
{@LOCATION NAMES}={?LOCATION}) and
{TransDetailCustomerView.ServiceType} in [1, 5]
However, when I refresh and preview the report, I get records that are in other service types than 1 or 5. Does anyone know why this would happen?Hi Gayle,
What I would try, is create a formula, with just part of your select statement in it.
Then create another formula that has more of the select statement.
say something like this.
not ({TransDetailCustomerView.Route} in 199, 299, 399, 499, 599, 699, 799) and
(not HasValue({?SUPPLIER}) OR {TransDetailCustomerView.VendorNo} = {?SUPPLIER}) then '1'
or this
not ({TransDetailCustomerView.Route} in 199, 299, 399, 499, 599, 699, 799) and
(not HasValue({?SUPPLIER}) OR {TransDetailCustomerView.VendorNo} = {?SUPPLIER}) and
not {TransDetailCustomerView.VoidFlag} then "2"
Then maybe an additional formula like this.
{TransDetailCustomerView.InvoiceDate} = {?DATE RANGE} and
{TransDetailCustomerView.ChainCode} 395 and
(if {?LOCATION}= "ALL LOCATIONS" then "3"
clear out your selection criteria, so that you return all records.
Then drop your new formulas in to the details section.
Hopefully it will be easy to determine where the select is getting the error. -
Record selection issue in same table
Hi All
I have the following table
with emp as (
select '11' A,'aaa' B, '40' C from dual union all
select '11','bbb', '40' from dual union all
select '33','ccc', '30' from dual union all
select '44','ddd', '20' from dual union all
select '11','eee', '10' from dual
)My expected results should be
A B C
11 aaa 40
11 bbb 40
11 eee 10Basically requirement is when select different combination of values in column 'B' need to find out what is the 'A' value (this has to be same for all three records)
Hope this make sense.
Cheers
ShabarHi all
Sorry for confusing you guys.
Basicall for the following data
{codes}
with emp as (
select '11' A,'aaa' B, '40' C from dual union all
select '11','bbb', '40' from dual union all
select '33','ccc', '30' from dual union all
select '44','ddd', '20' from dual union all
select '11','kkk', '20' from dual union all
select '10','eee', '20' from dual union all
select '11','eee', '10' from dual
I expexted results as11 aaa 40
11 bbb 40
11 eee 10
Ganesh Srivatsav : In your query results are bit different. Sorry I guess its my bad explantion
Cheers
Shabar -
Crystal Reports Cross-Tab Report not showing all available fields
I am running CR2008 against MS SQL Express. I have several tables with fields and data in them and can create standard reports to show all the data in all the fields. However, when I try to create a cross-tab report, only some of the fields appear for me to choose from.
I created a standard report with all the fields I needed in my cross-tab report and ran a preview. Everything was there. I then added a cross-tab object, selected the tables only to find that fields that are in the main report are not showing up for selection in the cross-tab.UPDATE: I exported the entire database from MS SQLExpress to MS Access and I am having the same issues, so it does not appear to be a problem with the database engine and, since the standard tabular reports show the fields, I am at a loss as to why they don't show up in the cross-tab or the Parameter fields.
I am creating the cross-tab through the Cross-Tab wizard. Is there maybe a bug in that? Is there a way to create it otherwise? -
Running Totals and Formulas with Cross Tabs
Hi,
I'm using Crystal Reports 2008 and am having two issues using Cross Tabs.
The first is that I want to have two crosstabs. They both will have a common Y axis (Oppourtunity.Sales Rep), and on the Y Axis I want one to show all (Opportunity.Create Date) where (Opportunity.Staus = Won) and the other where (Opportunity.Staus = In Process), but I can't figure out how to contruct the formula to return this result.
The other issue, is that in addition to summarizing based on Sum (Opportunity.Expected Revenue), I would also like to create a running total to show the cumulative (Expected Revenue) Week over Week.
Any direction would be fantastic.
Thank you,
MichaelPlease go through the SAP Notes listed here which would help you how to create mannual running totals in crosstab
[https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=runningtotalin+crosstab&adv=true¬e_number=&component=&sdn_updated_on_comparator=GE&sdn_updated_on=&sortby=cm_rnd_rankvalue]
Regards,
Raghavendra -
Issue with passing parameters through Java-JSP in a report with cross tab
Can anyone tell me, if there's a bug in Java SDK in passing the parameters to a report (rpt file) that has a cross tab in it ?
I hava report that works perfectly fine
with ODBC through IDE and also through browser (JSP page)
(ii) with JDBC in CR 2011 IDE
the rpt file has a cross tab and accpts two parameters.
When I run the JDBC report through JSP the parameters are never considered. The same report works fine when I remove the cross tab and make it a simple report.
I have posted this to CR SDK forum and have not received any reply. This have become a blocker and because of this our delivery has been postponed. We are left with two choices,
Re-Write the rpt files not to have cross-tabs - This would take significant effort
OR
(ii) Abandon the crystal solution and try out any other java based solutions available.
I have given the code here in this forum posting..
CR 2011 - JDBC Report Issue in passing parameters
TIA
DRG
TIA
DRGMr.James,
Thank you for the reply.
As I stated earlier, we have been using the latest service pack (12) when I generated the log file that is uploaded earlier.
To confirm this further, I downloaded the complete eclipse bundle from sdn site and reran the rpt files. No change in the behaviour and the bug is reproducible.
You are right about the parameters, we are using {?@Direction} is: n(1.0)
{?@BDate} is: dt(d(1973-01-01),t(00:00:00.453000000)) as parameters in JSP and we get 146 records when we directly execute the stored procedure. The date and the direction parameter values stored in design time are different. '1965-01-01' and Direction 1.
When we run the JSP page, The parameter that is passed through the JSP page, is displayed correctly on the right top of the report view. But the data that is displayed in cross tab is not corresponding to the date and direction parameter. It corresponds to 1965-01-01 and direction 1 which are saved at design time.
You can test this by modifying the parameter values in the JSP page that I sent earlier. You will see the displayed data will remain same irrespective of the parameter.
Further to note, Before each trial run, I modify the parameters in JSP page, build them and redeploy so that caching does not affect the end result.
This behaviour, we observe on all the reports that have cross-tabs. These reports work perfectly fine when rendered through ODBC-ActiveX viewer and the bug is observable only when ran through Java runtime library. We get this bug on view, export and print functionalities as well.
Additionally we tested the same in
With CR version 2008 instead of CR 2011.
(ii) Different browsers ranging from IE 7 through 9 and FF 7.
The complete environment and various softwares that we used for this testing are,
OS : XP Latest updates as on Oct 2011.
App Server: GlassFish Version 3 with Java version 1.6 and build 21
Database server ; SQL Server 2005. SP 3 - Dev Ed.
JTds JDBC type 4 driver version - 1.2.5 from source forge.
Eclipse : Helios along with crystal libraries directly downloaded from SDN site.
I am uploading the log file that is generated when rendering the rpt for view in IE 8
Regards
DRG -
Cross Tab issue , Need a Help
HI Expery
In BO Webi report need to show dynamic columns in Report after transposing rows to columns.
Data in Table is like below:
Col1 Col2 Col3
101 Abc 801
101 Abc 802
101 Abc 803
101 Abc 804
101 Abc 805
102 RNM 2009
102 RNM 2010
102 RNM 2011
103 RYZ 3465
In Report It should be as
Col1 Col2 Col3 Col3 Col3 Col3 Col3
101 Abc 801 802 803 804 805
102 RNM 2009 2010 2011
103 RYZ 3465
We have tried implementing the same using cross tab , but issue is in Cross col3 grows with all values present for all records. Here, if we use cross tab we are getting result as below:
Col1 Col2 Col3 Col3 Col3 Col3 Col3 Col3 Col3 Col3 Col3
101 Abc 801 802 803 804 805 2009 2010 2011 3465
102 RNM 801 802 803 804 805 2009 2010 2011 3465
103 RYZ 801 802 803 804 805 2009 2010 2011 3465Hi Ahmed
You can use the below logic.
col1 & col2 u can keep it as columns in a cross tab. Now keep col3 as row but here you need to do one thing . Click on the formula button for col3 field and then write the following syntax in it.
= col3 IN ([Col1];[col2])
By using this calculation context it will fetch only the data which is related to the first two columns. so the extra data which u were mentioning about will got to the next row.
Regards
Shyam
Edited by: Shyam Rapeti on Jan 25, 2012 3:20 PM -
Crystal Reports 10 Cross Tab Report Issue
I created a Cross Tab Report with multiple rows of data. It has two columns to return data for Year 2008 and Year 2009. When reading the database the report does not return data for rows that have a result of 0 in both columns even though Suppress Empty Rows is NOT checked in the Cross Tab Expert Customize Style Tab. Any suggestions as to how to get all of the rows to display including those with results of 0?
I'm guessing that your issue is that "results of 0" is really a lack of data, not that something is there and is summing to zero.
In that case, you need to base your report on an SQL Command. Take the SQL that the report is currently using, and UNION it with another select statement that returns all of the rows that you are looking for with zero values; something like this:
UNION
select category, 0 as PY_Value, 0 as CY_Value
from categories
This will cause the data to be there, which will cause the rows to display on the cross tab.
HTH,
Carl
(Resolution for 2010: Count the number of times this question is asked! :->) -
Hi I have created a cross-tab report using only two fields. enrollment_id and create_date. What is needed is a count of the # of enrollments and a summary for the week starting on Sunday. I have been able to do this however, they only want for the previous 4 weeks - I am returning all weeks since the start. I am not sure where to filter. Here is what I used in a regular report which worked but is not working in the cross-tab. The formula below gives me up to the last 4 weeks sunday to today.
not ({ISSUANCE.CREATE_DATE}in Last4WeeksToSun) and
not ({ISSUANCE.CREATE_DATE} in WeekToDateFromSun)
Here's what it should look like and includes a count up to today for week of 11/30.
Site_name 11/02/08 11/09/08 11/16/08 11/23/08 11/30/08
#issued 25 29 16 18 15
Any help would be appreciated.I figured this one out....needed to take out "not"
-
Issue in developing cross tab report with wizard in 10.1.3.2.1
Hi Gurus,
We are trying to develope group above cross tab report with wizard in BI Publisher 10.1.3.2.1 .
i am unable to achieve multiple level columns dynamically.Using cross tab wizard i can achieve single level measure column ,but not the second level column.
Output should look like this:
Country1
Region1 Region2 Region3 --(level1 column)
d1 d2 d3 d1 d2 d3 d1 d2 d3 -- (level2 column)
Row1 10 20 30 70 80 90 40 70 90 --data
Row2 21 24 54 65 23 64 64 76 87 --data
Here Regions and d1 d2 d3 may vary based on xml data.Also we have page break on country.
Haven't get any solution till now.
Also unable to achieve under line and overline on data for total row.
Need help urgently in this issue.
Thanks,
Mahesh
Edited by: user13450806 on Jan 7, 2011 12:43 AMHi Gurus,
I am still waiting for some one to help me in this issue.
It is very urgent for me to solve this. Did not get any help yet.
--Mahesh -
How Should select default (Apr-mar)month in cross tab?
HI Experts,
I have created webi report with cross tab format. In this report how should select Current year (April Month) to Next Year (March Month).
For Example:
2013 apr.......2014 mayHi Manikandan,
Similar to your previous post about selecting Fiscal Year, do this in BEx, Have a range on Fiscal Month which either the user can input the range or use Customer Exits to derive it.
The in your cross tab, having Fiscal Month in your columns will show the range selected.
with regards
Gill -
Issue using a parameter twice in record selection
Setup:
1) Crystal Report: (Client, Start Date, End Date) parameters linked to the Sub reports
2) Four sub-reports: (All open issues), (Oldest issue), (Average age of open issues), (Average age of closed issues)
I need to report on issues based on Customer types of "Company" and "Customer." All of the records I'm reporting on are in the same table (Subset), but the "Client" parameter I'm using exists in two different columns depending on the Customer type.
ie. My paramter for "Client" is "ABC"
"ABC" is found in Subset.Sitename for (Company records)
"ABC" is found in Subset.Companyname for (Customer Records)
My record selection formula is:
{Subset.Companyname}={?Pm-?Client} or {Subset.Sitename}={?Pm-?Client}
Showing the SQL query shows both values filled in correctly, and if I paste the query in SQL, I get the correct result set. But if I use any kind of "Running total", "Average", "Maximum", etc... functions, Crystal doesn't include my Company records in its evaluations. It only evaluates Customer records.
Does anyone have a work-around for this? Is this is a limitation?All Open Issues -- My work-around was:
1) Running total (count) of open Customer issues
2) Running total (count) of open Company issues
3) Formula (sum) function of 1 and 2
Oldest Issue -- No workaround yet; Parameters listed above are in the Record selection
1) Datediff between Received date and Current date
2) Maximum of the Datediff results
Average Open - No workaround yet; Parameters listed above are in the Record selection
1) Datediff between Received and Current Date
2) Average of Datediff results
Average Closed - No workaround yet; Parameters listed above are in the Record selection
1) Datediff between Received Date and Closed Date
2) Average of Datediff results -
Record no/Serial no in cross tab based on grouping
Hi Experts,
How to get Record no/Serial no in cross tab based on groupingCR 2013 support pack 2 version 14.1.2.1121.
Kindly check the screen shot -
Cross tab & Line Graph – Data Sorting issue
Hi,
Want to display data in specific order in cross tab row & in graph as shown below
Account Name
Average
Median
In the same order data has been retrieved from the database but when it comes to Crystal report, its reordering the data in alphabetical order as shown below due to the order set in Group option
Example: 1
ABC
Average
Median
Example: 2
Average
Median
XYZ
Please note u201CAverageu201D & Medianu201D are constant but Account name will vary based on selection.
How this can be achieved? How Specific Order can be used in this case?
Please help... Itu2019s urgentu2026
Thanks,
ThakurSHi
Under "chart expert" in "data" tab where you add the fields in chart you see "on change of" and "show" values..
After adding the required on "change of fields" if you would highlight that field "group option" tab will get enabled where you will find the "sort order" drop down. There is an option "In Original Order" which will sort the fields as fetched from Database
Same option is available in Cross-Tab
Regards,
Shantanu
Maybe you are looking for
-
Can't watch NBA League Pass with WiFi
I am experiencing the following with NBA League Pass: 1) On TV: I can watch all teams. 2) On my iPad and iPhone with AT&T cellular data: I can watch all teams. But this is too expensive, as one game will eat up 3 Gigs of data. 3) On my computer, iPa
-
EJB 3.0 in a real world open source project. Great for coding reference!
If you are interested in seeing EJB 3.0 implemented in a real world project (not just examples) or if you are interested in learning how to use them I suggest you to take a look a the open source project Overactive Logistics. It has been written tota
-
Hi There, I want to know under what circumstances I can use or not use MsgBox in a Visual Studio 2008 SqlServer Project? E.g. I cannot use MsgBox in an deployed assembly, that causes something like: attempt to use resources forbidden by the CLR host.
-
JComboBox - Bias With White Space
Is there a simple way to bias an editable JComboBox with a single space so that the text isn't pushed up against the left side of the box? This is a solution but only works on uneditable JComboBoxes due to using a Renderer and not an Editor. http://f
-
I have an Ultra 10 and can't load Solaris 10 because of an error that the machine won't support the operating system. So I tried to reload Solaris 8 after a format and receive an ata_timeout c0 d0 error and I don't know how to get around this to load