How can I get results to show only >=10.3 in Crystal Report - crystal-reports

I have a report not showing results for anything >=10.3. How can I get my report to show >=10.3 in one column.
Below is the line of code I am using and my results are coming out blank.
if {tblcomplete.Test}= "Calcium" and {tblcomplete.Num Res} >= 10.3 then {tblcomplete.Num Res};
Different line of code I tried and still came out blank.
if {tblcomplete.Test} = "Calcium" and {tblcomplete.Num Res} >=10.3 then ToText({tblcomplete.Num Res} ,2,"")
Image below shows results for Calcium on the right column. Left column is for any results >=10.3 to show.

Related

Why is Arrayformula returning only the first row

Update: sample sheet provided here: https://docs.google.com/spreadsheets/d/1BapXdaVOUL634SstNJXqYNocsD_EvvtlbJ77vlElmZs/edit?usp=drivesdk. Any help will be appreciated!
Hi fellow nerds.
I'm trying to make the current column (most recent interaction date with client) display the max values (most recent dates) from ContactLog!b:b (dates of all recorded interactions), when the client name in ContactLog!A:A matches to the client name in current row column A.
After many days of trying, I've found several formulas to successfully achieve this result for the current cell only.
=MAXIFS(ContactLog!B:B, ContactLog!A:A, A:A)
=MAX(FILTER(ContactLog!B4:B, ContactLog!A4:A=VLOOKUP(A2, ContactLog!A4:B, 1, FALSE)))
=MAX(QUERY(ContactLog!A4:B, ""SELECT B WHERE A = '""&VLOOKUP(A2, ContactLog!A4:B, 1, FALSE)&""'"", 0))
=IF(COUNTIF(ContactLog!A:A, A2),MAX(FILTER(ContactLog!B:B, ContactLog!A:A = A2)),"")
But none of these seem to work with arrayformula, to spread to the entire column. I'd like this result to apply automatically to the entire column (wherever column A is not blank).
It's displaying the correct max value for the first cell (in which the formula is written), and I could drag the formula down, but not spreading automatically as an array.
I've tried using =match with =filter, but that keeps running into mismatched range row sizes. (I've previously solved that by using filter within a filter, but can't figure that out here).
[I have a similar issue for the nearby columns also, "most recent interaction method", and "reminders & goals". The formula there is:
=INDEX(ContactLog!C:C, MATCH(MAX(IF(ContactLog!A:A=A2, IF(ContactLog!B:B=MAX(IF(ContactLog!A:A=A2, ContactLog!B:B)), ROW(ContactLog!B:B)))), ROW(ContactLog!B:B), 0))
And
=IFERROR(CONCATENATE(JOIN(" • ",FILTER(ContactLog!D:D,ContactLog!A:A=A2, ContactLog!D:D<>"")),IF(INDEX(ContactLog!D:D,MAX(IF(ContactLog!A:A=A2,ROW(ContactLog!D:D))))="","","")),"")
They both work great, but I can't get them to work with arrayformula...]
What am I missing?
You can do something like this with BYROW, that allows you to expand your formula through the column and be calculated "row by row". Using your first option:
=BYROW(A:A, LAMBDA (each,IF(each="","",MAXIFS(ContactLog!B:B, ContactLog!A:A, each))))

Crystal Report's Report Viewer "A statement is expected here"

I am using Crystal Reports 2016 and am trying to get a QR code solution to work in Report Viewer. The QR code prints flawlessly with the packaged QR font in the Crystal Reports editor, but in Report viewer, it throws an "A statement is expected here" error (see screenshot).
The code I am using is the QR solution vendor's code inside a formula field with Basic syntax:
ConnectCodeClassQRCodeEncode ({search_loc.LOC_DESC},"L",8)
Dim x As Number
Dim Result As String
For x = 1 To ConnectCodeClassQRCodeNumBlocks()
Result=Result + ConnectCodeClassQRCodeGetBlocks(x)
Next x
formula = Result
Is Report Viewer expecting Crystal Syntax instead of Basic Syntax? Or is Report Viewer not knowing where to find the ConnectCodeClassQRCodeEncode function?
TIA
You need to install the UFL providing that function on the target machine.

Empty rows in report when using count function

I am using BIRT reporting with my mongodb datasource. I am trying to COUNT some events. COUNT function gives the correct value but there is big empty space at the end of the page depending upon the count value. If the count value is big then the rest of the page is empty and on the next page same record is coming e.g. :
In this Image the rest of the page is empty and same record is coming on the next pages also. It looks like empty spaces are being printed.
This is how my report looks like :
The COUNT function:
I have tried using SUM also but I get this error when I use SUM function instead of COUNT :
org.eclipse.birt.report.engine.api.EngineException: A BIRT exception occurred. See next exception for more information.
Can not convert the value of True to Double type.
at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1245)
at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1224)
at org.eclipse.birt.report.engine.executor.DataItemExecutor.execute(DataItemExecutor.java:101)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.execute(HTMLAbstractLM.java:468)
Please help, thanks in Advance.
I got the issue to this problem. If we select "Hide Detail" Option from the group then this problem go away.

SAP Subreport will print to PDF but not to viewer or printer

I have two different SAP Crystal Reports, one has sub reports and the other doesn't. For whatever reason the simple CR prints to the printer, to PDF and to the viewer just fine. The CR with subreports only prints to PDF for whatever reason. This is leading me to believe there's nothing inherently wrong with the report itself otherwise it wouldn't work when I save to PDF.
A snippet of my code is below (in VB):
Select Case PrintMedia
Case PrintType.Printer
crOrderPrintout.PrintToPrinter(1, False, 0, 0)
Case PrintType.Viewer
Dim frmReportViewer As New frmReportViewer
frmReportViewer.CrystalReportViewer1.ReportSource = crOrderPrintout
frmReportViewer.ShowDialog()
Case PrintType.File
crOrderPrintout.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, String.Format("C:\Documents and Settings\{0}\Desktop\{1}.pdf", mdlSharedVars.StripDomainFromFullUsername(WindowsIdentity.GetCurrent.Name), ReceiptID))
Case Else
crOrderPrintout.PrintToPrinter(1, False, 0, 0)
End Select
For clarification the PrintMedia is a variable whose type is a custom enum of mine, PrintType.
When I try to show the report with the subreport in the viewer or print to printer I get a "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter: index." error. Yet the simple, non-subreport CR works just fine regardless of the PrintMedia.
Don't suppose anyone has any ideas??
After fighting with this for longer than I care to imagine, it turns out there was a problem with one of the fields in the crystal report display string. Basically I started the report from scratch, adding in piece by piece trying to isolate the error.
Can you try the report in an off the shelf Crystal viewer or Crystal Reports itself? Does it work?
Maybe try setting the printer options in page setup to "No Printer (Optimize for screen display)"

Crystal reports 11 : blank field bombs the report

I'm creating a invoice crystal report for sage mas 500 AR module. In it, I'm attempting to add the tarinvoice.balance field with the following formula:
if {tarPrintInvcHdrWrk.Posted} = 1 then
ToText({tarInvoice.Balance})
I'm assuming that when the {tarPrintInvcHdrWrk.Posted} = 1 conditional statement holds FALSE, it doesn't attempt to pull the invoice field because when I remove the formula from the report, the form displays correctly without it.
When the conditional statement renders true in the report, the balance fields behaves correctly. However, with the formula renders FALSE in the CR form, the entire crystal report bombs and displays blank. Any ideas why or what I'm doing wrong?
Just tried setting everything to zero and the report still bombs. I'm starting to think its more of a query error in the report. I wish there was a way to exclude the field in the query when posted = 0.
With tarinvoice.balance removed when the posted = 0, the report works fine.
With tarinvoice.balance included and posted = 1, report works fine.
With tarinvoice.balance included and posted =0, report bombs.
I believe the conditional statement fails immediately if you encounter a NULL, so your formula needs to test IsNull({tarPrintInvcHdrWrk.Posted}) before it tests equality with "1".
You can change the way Crystal handles a null value for a value in a formula. At the top of the Formula Workshop there is a drop down box that usually says "Exceptions For Nulls".
Change this to the other option "Default Values For Nulls" and your formula should no longer bomb out. You used to be able to specify the what the default values applied were, but more recent versions of Crystal have these hard coded.
Search the help for "Null Treatment" for a table showing them.
I modified the formula to this:
if isnull({tarPrintInvcHdrWrk.Posted}) = FALSE then
if {tarPrintInvcHdrWrk.Posted} = 1 then
if isnull({tarInvoice.Balance}) = FALSE then
ToText({tarInvoice.Balance})
else
"0.00"
else
"0.0"
else
"0"
The crystal report still bombs.. Nevertheless, it does show "0" in the appropriate space.
I saw a suggestion on Exp.Exch to try putting the field into a variable before converting it to text.
e.g.
NumberVar InvoiceBalance;
If isnull({tarInvoice.Balance}) then
InvoiceBalance := 0
Else
InvoiceBalance := {tarInvoice.Balance};
If {tarPrintInvcHdrWrk.Posted} = 1 then
ToText(InvoiceBalance);
I also tried to recreate your problem, since I have see similar things before.
No luck though trying with CR 8.5 & XI R2. Perhpas it has to do with linked tables as well, since I only tried on a simple single table.
I have also seen similar behaviour when using a formula within a Running Total - they do not like nulls at all!
If you put {tarInvoice.Balance} directly on report (into details "debug" section - often needed, don't forget supress it in production :)), what values it displays or does report become empty?
Maybe you have Suppress If Blank section on your report. Try to put: Else " "
if isnull({tarPrintInvcHdrWrk.Posted}) or {tarPrintInvcHdrWrk.Posted}=0 then
" "
else
if {tarPrintInvcHdrWrk.Posted} = 1 then
ToText({tarInvoice.Balance})
else
" "
I have trouble with this kind of field when making reports to export to excel. A field with no data in will pull all columns to the right of it over to "fill the gap".