How to sort a Crystal Report in Visual Studio 2015 - vb.net

I am using crystal report add-on on my visual studio 2015. I have a problem, I have access database with table looks like in images:
I want to sort my database with field tanggal_pembayaran as parameters, using group selection in selection formula on crystal report but here is what the formula looks like:
I don't know which formula to use to make it like that parameter becomes the initial limit for the report date to display data with date above the entered date which i don't know how.

To Filter and Sort by a Parameter field in crystal report
create a parameter Field
right click the parameter field in field explorer and add new
give name and datataype (here datetime)
to filter data using parameter field
Go to Reports>>Selection Formula>>Records and provide formula
here it will be like
{Customers.CreationDate}<{?Creationdate} save and close
to Sort data using parameter
Go to Report >> Record Sort Expert>>From report field add the Parameter field.If not visiable add the field first to the report then it will be visibale

Related

How to program crystal report to lookup a record in a table

i Have a Table with Fields
Material Number
Order Code
Supplier Code
Description
I have a crystal reports rpt file that i manually enter all the information to generate labels.
I am trying to program this using the built in formula editor, so when i enter the Material Number (which is a unique code) it will automatically display other 3 relevant fields.
I have tried few formulas in the formula editor without any luck.
can anyone help?
relliK
UPDATE
#Siva - I have added the table for clarification
i simply want a lable printed with only one user input being the Material Number, and then the code/fomula in crystal reports to fetch the other data based on the Materila number and produce the label.
thank you for you interest in this issue.
UPDATE
#Siva - I have added a sample label, i would only want to enter 20506871 as Material and the other data fields to be pulled from excel
not sure if i can use parameter fields and/or i would like some help on programming the parameter fields

Formula record in Crystal Reports not working

I'm using VB.NET 2010 with Crystal Reports 13_0_10, and I'm getting an error in setting a parameter in Crystal Reports: the result doesn't filter by my formula.
I create parameter field (number) called id then make formula record:
{Attechment_AB.attid} = {?id}
then in VB.NET pass value to Crystal Reports by
rpt.SetParameterValue("id", txtId.Text)
When I used VB.NET 2008 the code worked correctly, but now it displays all the values of the table.
If you need to filter the data according to some parameter then you need to write the formula in Record Selection Formula and not in formula editor.
You can get the record selection formula from Report -> selection formula --> record selection formula tab in crystal report.

How to change the parameter type in crystal report of the existing report?

I have a crystal report with 2 subreports. The type of the one of the field got changed in the database from number to string. The main report has no parameters but the subreport has this parameter. Now when I try to run the report I get the error in the record selection formula. A string is expected here. My question is How do I make the type change for that field so that I can run my report. ?
Easy to do. And FUN, too!
Assuming you can change the link to the subreport, you can:
1) create a formula to manipulate that field in the main report, explicitly converting it into the format you neend. Then,
2) use THAT formula as the link to the subreport
Should work a charm, "Bob's yer oncle", and all that.
The solution was to remap the bindings of the report with the changed datatype in the dataset

Using Subreports in Crystal Reports in vb.net

I have used 2 sub reports in my crystal report. Both these reports are from separate tables having no connection between them...I have inserted these reports in the details section....I have used dataset to pass source data to these reports...But when i view the report, the sub reports' data isn't filtered according to the dataset rather all the rows are shown in the reports.. How can i get rid of this problem....i just want to view the data like if user wants to view a report for 2011 then it should only show information from the database records having 2011 as the Year part...Can anyone help me on this
The solution to your problem is dependent on how your user specifies the criteria for the report and where in your application they enter that criteria.
For example, if you provide a prompt for the user within your application to get the year for the report, then retrieve the datasource and pass it to crystal, then you should filter the data in the datasource before passing the datasource to crystal. You could also set parameters in crystal to filter the data, but my rule of thumb is to retrieve as little data as necessary to provide the required information.
However, if the user is prompted from within crystal reports for the criteria, then you need to use standard crystal functionality to filter the data. This involves adding record selection formulas using the user entered parameters.

Substitute one table for another at runtime

I have 9 tables with state information in them. They all have the same field names. I have a Crystal Report that is based on one of them. I want the user to be able to select a state and change the Crystal Report to use that table instead of the one it was based on.I mean when user select text in combo box and then click on "OK" then report show (using only one rpt for all the tables of same fields).
How do I do that in VB.Net?
Could you base the Report on a Stored Procedure and pass in a parameter so the Stored Procedure knows which table you want the data from?
I remember trying to get a Crystal Report (v2005) to switch database source from the one it was designed against and that wasn't easy - every table had the connection details in it if I recall correctly! (maybe changing tables is easier though)
It's not easier but if the tables have the same structure you should be able to do it. But you should create a new Document for it and call SetDataSource for your new table. After this you can set the document as ReportSource to your viewer.