Crystal Report Selection Formula - vb.net-2010

Good Morning! As i was developing my software (School Management) using VS 2010 and SSMS without any problem, until i reached the final stage where i want use a crystal report to print a Student Report. in my software i used Table Adapter to generate the student on datagridview before attempting to print. using
[Me.Assessment1TableAdapter.FillBySession(Me.EMS.Assessment1, cboRSession.Text, cboRClass.Text, cboRTerm.Text, cboeReg.Text]
where i will select Secion, Class, Term, Reg. before i generate the Students List. so Please what is the best way for me to create a Crystal Report because i want add some tables in it for Teacher's comment and i am very new to Crystal Report. Thank you!

I solved the Problem by using Selection Formula which is :
REPORT_SHEET.CrvReport.Enabled = True
REPORT_SHEET.CrvReport.ReportSource = "C:\Users\MUSTAPHA YUSUF\documents\visual studio 2010\Projects\SMS\SMS\Student_CrystalReport.rpt"
REPORT_SHEET.CrvReport.SelectionFormula = "{Assessment.ID}=" + Sol.Text
REPORT_SHEET.CrvReport.Refresh()
REPORT_SHEET.CrvReport.RefreshReport()
REPORT_SHEET.Show()

Related

BC: How to add a dataset and modify a report from 'base microsoft' with a 100xx ID?

I am trying to modify a report that is given by base microsoft and I can't figure out how to 'replace' and add a dataset the 10081 report.
I have tried copying the report and modifying it, but I need to add a dataset and don't have access to the al code due to it being a base microsoft report.
I tried to make a new report, it just wont appear when I try and got o the returns. When I try to replace the 10081 report with the custom 5014x report it gives me an odd error like 'textbox billtity needs to be named billtocity' even though it is. I have also included the '=First(... , 'dataset') in the expresssion
Any youtube links, links to documentation or anything would be helpful.

How to remove blank spaces from a detail section?

Hello and greetings to the community.
I have the following report made in Visual Studio 2015 using VB.NET and Crystal Reports:
Those boxes that I painted in light blue are the white spaces that I want to eliminate. The section that contains this information in Crystal Reports is as follows:
In that section, I have the following associated function, which only contains the functionality of showing or not the section depending on whether the TipoDocId is NULL:
IF IsNull ({SpCon_CONTA_Rpt_LibroDeInvBalances_Cta14;1.TipoDocId} ) THEN
true
ELSE
false
I'm sorry to use images, but for this specific problem it's the only way to show the problem.
Thanks in advance for your responses.
Looks like you simply need to suppress Detail Section 2.

How to create a program to convert unit measurements

Using Microsoft access, visual basic.
I'm having a big problem doing this task.
What I have done: Created a table on access where I have put measurements in (from meters):
mile = 10000meters, nautic mile = 1862meters, English mile=1652, kilometers = 1000 meters and all the way down to Millimeters.
What I have created for input:
1 box takes an Integer to be converted and a 1 box specified with an initial unit.
What I have created for Output:
1 box shows the Integer of result with 1 box specified the chosen unit of the output.
Can anyone please, please help me with the codes?
Honestly I'd never really noticed the CONVERT function until today but here's a quick demo of how I'd slap together a "conversion tool" in Excel.
If you want to do the same thing in Access, the premise is the same, but it will be a bit more work since you'll have to design the form from scratch instead of using a worksheet, which is kind of meant for this kind of job.
Using Excel functions in Access
Before you are able to use Excel's CONVERT function in Access, you'll need to reference the Microsoft Excel Object Library.
In Access, open any VBA Module.
GoTools > References
Check the box next to Microsoft Excel 16.0 Object Library. (The version number will vary if you have an older version of Office.)
Then you can call most Excel functions from Access VBA or queries with WorksheetFunction (the same way you would use them in Excel VBA).
For example:
MsgBox WorksheetFunction.Convert(3.7, "m", "ft")
...displays a message box with the number of feet in 3.7 metres.
The calculations will be the easy part; a couple lines of VBA in the On Change or On Exit events will trigger the calculation.
The most time-consuming part will likely be perfecting the placement and formatting of the controls on the form, which is by no means difficult (and there are several tutorials online that can provide the basics if necessary.)
Lastly, keep in mind that there are no doubt a plethora of existing conversion tools available for free download with a little Googling... (I'm confident that you're not the first person who wanted to use MS Office to convert measurements.) 😉
More Information:
Microsoft Docs : WorksheetFunction.Convert Method
Microsoft Docs : List of Worksheet Functions Available to Visual Basic
Office Support : Create a form in Access
QuackIt: Microsoft Access Tutorial
Blueclaw : Access Event Procedures
You can download the demo xlsx used above from JumpShare here.
For both comboboxes, bind them to column 2, faktorTilMeter, and set the ColumnWidths to, say: 2,542cm;0cm.
Then, assign this expression as ControlSource for your output textbox:
=TextboxInput/ComboboxFrom*ComboboxTo

How to run a report by default in excel in code?

I have tried
ChosenOutputMethod := CustomLayoutReporting.GetExcelOption;
on the report but when I press preview, it doesn't export to excel. I want to achieve so that every time when run, the report is exported in excel document.
I want it to be in the report itself as of report 116 customer statement.
I don't want to use SAVEASEXCEL function
I'm afraid it's possible only using SAVEASEXCEL. Any reason why you don't want to use it?
You can also use the Excel Buffer to create reports in Excel directly.
Cheers
You need to press Print -> Microsoft Excel button.

What is the reason of this error in Crystal Reports?

I have a problem with the crystal reports.I have a report in which four tables are bound as source to the tables.In those 4 tables one table database fields are used in the formula fields.When I set that formula field on the report I am getting error this error "Unknown Database Connector Error" in the Preview Report.
Suppose when I remove that field or comment the formula code of that field we are not suppose to get that error.I don't understand that error too.
I have written like this in the formula field
if{students.name} = "" then
else
"Student Name : " + {students.name}
I have googled alot but no use.Can any one help me regarding this ?
I found a solution to install the crystal report for .NET framework 64 bit software.I will be solved :-)
Try:
If Not(Isnull({students.name})) Then
"Student Name : " + {students.name}