I have two different reports in Cognos.
Whereas in both the reports I have the field called "%Target".
In the report 1 the field is directly coming from db and in the report 2 the field is formulated.
My question is for e.g. if a value is 98.47% (directly coming from db) in report 1 where after applying formatting it give me the rounded value as 98.5% but however in report 2 (where the field is calculated e.g. A/B) this value is populated as 98.4%
Can anyone please explain why this happening.
However I tried using ceiling function. But nothing is working on the report.
Related
I am using 3 TDBText components on my form and using the following SQL to populate them:
TO_CHAR(myField, '0000.00') "AMOUNT"
where myField are 3 different numeric fields.
One of them is displaying correctly (eg '9983.66'), but the other 2 are displaying as '#######'. I've checked the properties for each DBText and they are identical (apart from the field).
Sorry, just figured it out. There weren't enough zeros in the mask to accomadate the number. I've changed the format to '000000.00' and it's working fine
unfortunately I'm not an expert of Crystal Report, so I'll post here my question hoping for any help about my issue.
I want to display inside my report the result of a filter on a SQL RecordSet; this RecordSet is looked up from an a single table, of which I want to show some fields of my SQL table, while the filter I want to apply is based on a field parameter (defined static) that I'm trying to set programmatically.
Here below I attached my code where I'm applying the record selection formula, I tried also hard-coding the value instead of passing it through a dropdown selection:
ReportDocument RPT_Doc = new ReportDocument();
RPT_Doc.Load(RPT_Path_Name, OpenReportMethod.OpenReportByDefault);
ApplyConnInfos(ref RPT_Doc);
RPT_Doc.SetParameterValue("data_riferimento", "20161001");
RPT_Doc.RecordSelectionFormula = "{viaggi.data_part_pre} = '20161001'";
crystalReportViewer1.ReportSource = RPT_Doc;
In the first image attached you can find the field parameter definition, while second image is the record selection formula I defined inside my report:
The report always shows all the records of my table (more than ten thousand rows), instead of displaying a filtered RecordSet. The odd thing is Preview function from Visual Studio works like a charm; it prompts the field value, once I confirm the value the viewer displays the report with the rows filtered as I expect..
What am I missing from report/C# program configuration to make the record selection work?
Thank you in advance for any suggestion you can give me :)
Leonardo
Ok, finally we got the solution to our issue.
We found the CrystalReportViewer object used to display generated reports has 2 different properties, SelectionFormula and ViewTimeSelectionFormula; both has default value set to empty string.
Below I attached the picture of .Designer.cs file with the 2 properties valued:
We commented those 2 properties and the selection formulas and field parameters applied through code / report designer worked again.
I have a report that I already created in which this works. I have three parameters in my first report with a matrix. The matrix column and rows are based off of two calculated fields. The row field is called Time Summary and is basically a time range like follows (8AM-10AM,10AM - 12PM, 12PM-2PM,Etc.) The column field is just days of the week (Monday,Tuesday,Wednesday,Etc.) They were both calculated by a field called 'CreatedDateTime'. The value column is a count of request numbers so we can see when our call center is receiving the most service requests and at which times.
I'm drilling down to a detail report that lists each request and many of the request details. I created an action on the value (count of request) textbox in my matrix report that makes it drill into the detail report. In the detail report I have the same three parameters as in my first report, but I also have parameters for the row and column fields of my matrix (Time summary and day of the week respectively). Here is a screenshot of my text box properties screen in the action tab.
The problem I'm having is that when I run my matrix report and click on the value that I want to drill into, it will drill into the detail report and update the parameter values for the three that are also in my matrix report, but it won't update the parameters for the values in which I selected in my matrix.
Here is another screenshot of what happens when I select a value in my matrix and it drills into the detail report. I have the calculated fields in my detail report too and it filters the main data set based off of the Day parameter and Time Summary parameter. I made a report yesterday very similarly and it worked. I can't figure out why it I can't get this report to work. I'm almost positive it has to do with how I have my parameters defined in my detail report or something with the text box properties and the action. Any help in figuring this out would be appreciated.
I have a formula written for a field in Crystal Reports. When i refresh the report, i get a different value from the formula. The required value is always the last value in Browse Field Data dialog for that formula.
Isnt the formula supposed to have only one value as output? why are multiple values shown in browse field data dialog.? Is there a way to retrieve last value of Browse File Data dialog?
My formula looks like below:
WHILEREADINGRECORDS;
NumberVar CODTOTAL;
if {XXX.YYY} = 1 then
( CODTOTAL := CODTOTAL + {XXX.ZZZ};
);
CODTOTAL;
Browse field data shows all the values "CODTOTAL" acquires as a result of that formula and displays a random value amongst the assigned value.
Please help me out. I am amateur in crystal reports.
Any help would be highly appreciated.
~Regards.
First observation should be where have you placed the formula (Details, Footer.. etc).
why are multiple values shown in browse field data dialog.?
Browse field shows the data that is present in the table but in your case you are applying "If" condition of the filed. It can be possible that there is only one record that satisfies your condition.
I would suggest to run the report without the codition, Check the results and apply the condition and check results again.
I have a VS 2010 Report, and I would like to pass values that are calculated inside of one .rdlc report to another. Can I somehow use the Parameters to send data back out of the report, or have some "return" value from the .RDLC?
I don't think you can have return values with report services.
Instead, assuming that the two report have different dataset, the only solution I come out so far is to include two dataset in your second report and recalculate your field.
Doing that, you can use your normal expression to calculate the values that you need from the first report specifying the first dataset.
Here really simple example:
Report 1
The report is using only the DataSet1
=Fields!AField.Value
Report 2
The report is using two dataset: DataSet1 and DataSet2
=(Fileds!AField.Value, "DataSet1") + (Fields!AnotherField.Value, "DataSet2")
Ofc the expressions could be more complex, but the most important thing is to specify the DataSet where the report have to take the filed.