Search This Blog

Showing posts with label report code. Show all posts
Showing posts with label report code. Show all posts

Balance Code

This code will check if textbox 1 is equal to textbox 2. If the two quantities is not equal a messagebox 'Not balance.' will appear but continue printing if balance at all.

IF !EMPTY(THISFORM.Text3.Value)
IF (THISFORM.Text1.Value) = (THISFORM.Text2.Value)
REPORT FORM "C:\GenLed\Reports\ReportJournalEntry" TO PRINTER PROMPT NODIALOG PREVIEW
THISFORM.Refresh()
ELSE
=MESSAGEBOX("Not balance.", "Confirmation")
ENDIF
ELSE
=MESSAGEBOX("Choose Journal Entry.", "Confirmation")
ENDIF

Trial Balance Report


Trial Balance Report

Here is the sample report designer or FRX. You can use groups in the report designer. As you can see, I used Data Groupings. You will group by the field "Name" for example. In the group footer, you can use a variable which sums the field "amount". Right click your report and look at the tabs Data Grouping and Variables.

Special Thanks to Samir of Foxite.

FoxPro Graph

To those who are neophyte in VFP Language might have a hard time researching and building a graph in a form and report. I also had a hard time making a graph when I first encountered a VFP Project with a graph. But once you learned, it is easy for the next project to bulid a graph in form and report.

You need the following requirements before continuing to the graph:
Table
OleGraph
Grid

SELECT * FROM crewquestion INTO CURSOR MYCURSOR
TAB = CHR(09)
CRLF = CHR(13) + CHR(10)
SELECT MYCURSOR
NEWDATA = TAB + "Recruitment & Selection" + TAB + "Documentation" + TAB ;
+ "In House Training" + TAB + "Accounting Activity" + TAB + "Working Gears" + ;
CRLF
SCAN
NEWDATA = NEWDATA + TAB + STR(question1) + TAB + STR(question2) + TAB ;
+ STR(question3) + TAB + STR(question4) + TAB + STR(question5) + ;
CRLF
ENDSCAN
SELECT crewquestion
APPEND GENERAL crewques1.Olegraph DATA NEWDATA
SELECT crewquestion
THISFORM.REFRESH

SELECT * FROM crewquestion INTO CURSOR MYCURSOR
TAB = CHR(09)
CRLF = CHR(13) + CHR(10)
SELECT MYCURSOR
NEWDATA = TAB + "Padala Sytem" + TAB + "Company Facilities" + TAB + "Attitude of Staff" + TAB ;
+ "P&I Medical Assistance" + CRLF
SCAN
NEWDATA = NEWDATA + TAB + STR(question6a) + TAB + STR(question6b) + TAB + STR(question6c) + TAB ;
+ STR(question6d) + CRLF
ENDSCAN
SELECT crewquestion
APPEND GENERAL crewques2.Olegraph DATA NEWDATA
SELECT crewquestion
THISFORM.REFRESH

Report Code

Calling a report from a form is very easy. You can even call a multiple reports that comes from your application. Microsoft Visual FoxPro is very flexible, you do not have to install other application in making print reports. VFP 's built in reports can call view from a table either local or through local area connection such as SQL from a server.

txtName = ALLTRIM(THISFORM.txtName.VALUE)
txtBirthDate = ALLTRIM(THISFORM.txtBirthDate.VALUE)
txtBirthPlace = ALLTRIM(THISFORM.txtBirthPlace.VALUE)
REPORT FORM "C:\ProjectName\Reports\Resume" TO PRINTER PROMPT NODIALOG PREVIEW

Print Report Code

This code will help you call a report. Report Form "" Preview or To Printer Prompt Nodialog Preview

Report Form "C:\Project\Reports\PrintReport" Preview
Report Form "C:\Project\Reports\PrintReport" To Printer Prompt Nodialog Preview