Friday, March 30, 2012
Print fixed number of rows per page
and want to print 15 rows per page - even if there are less data rows
available for my grouping. The blank rows (printed with borders) are
used to write in additional transactions throughout the day.
Any way to accomplish this? I am new to Reporting Services.
Thanks.Try this in the group expression.
=Int((RowNumber(Nothing)-1)/15)
Amarnath, MCTS
"jjoll" wrote:
> I am trying to migrate an existing report / form. I am using a table
> and want to print 15 rows per page - even if there are less data rows
> available for my grouping. The blank rows (printed with borders) are
> used to write in additional transactions throughout the day.
> Any way to accomplish this? I am new to Reporting Services.
> Thanks.
>
Saturday, February 25, 2012
previewing specific records in a report
I have a form which contains records about patients. the primiary is PatientID and is based on the national ID number.
I have compiled a query to show the patient's bill (invoice). from this query I have created a report. i have placed a button on the same form mentioned above that will open the report. right now the button opens the report and all the records are showing.
i would like it that when the user goes to a particular record in the form, the user can click on the button to preview just that record's bill and no others.
i'm using access 2000.
bajanElfi should also mention i was told that i could "fix" the query in sql, but i'm not to sure how to do that.|||Originally posted by bajan_elf
i should also mention i was told that i could "fix" the query in sql, but i'm not to sure how to do that. The simplest answer is to build a criteria that restricts the query to just the data for a particular employee or bill. Without knowing a good bit more about your application, I can't really give you any specifics. The basic process isn't tough, you just add a criteria in the query form where client_number = x or where bill_id = y.
-PatP|||hmmm... no worries Pat. i got it working. it seems i needed a piece of code inthe command button the opens the report. below is what i added.
DoCmd.OpenReport stDocName, acPreview, "", "[PatientID]=[Forms]![frmAppointments]![PatientID]"
so in fact i didn't really need sql. thanks for taking the time to look at my post anyway tho, it was greatly appreciated.
bajan elf
preview current data from vb form to Crystal Report
i have a question here and need u'r help.
i have sales data in my vb form, and i want to preview or print it using crystal report. my problem is, crystal report print all sale data in my table sales. all sale data have their own resit number. how can i print only data with resit number that i key in, in my vb form?
hope u can help me...
TQTry the example attached to my post|||dear joe911..
thank u...but i can't open the attachment. can u tell me how i can open tha file that u given,..|||it is compressed with wiarar: http://www.rarlab.com
by the way this example apllies to ver 9.2
here is another one compressed using winzip|||thanz joe..|||i've try the code but i still have a problem. crystal report still preview all the data in sales table.
can anyone help me...|||u sure that u did like the example?
plz upload ur project|||Dear joe...
here is my coding...i use sql server as my database. Hope u can tell me what is wrong with my coding...
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Dim adoSql As ADODB.Connection
Private Sub Form_Load()
Dim strSQLStatement As String
Dim rsReport As ADODB.Recordset
strConnection = " Provider=sqloledb;data source=PRE;User ID=sa; initial catalog=PSM"
Set adoSql = New ADODB.Connection
Set rsReport = New ADODB.Recordset
adoSql.Open strConnection
strSQLStatement = "SELECT * FROM TSales" & _
" WHERE day ='" + Form5.DCday.Text + "'" & _
" AND month ='" + Form5.DCmonth.Text + "'" & _
" AND year ='" + Form5.txtyear.Text + "'" & _
" AND member_id= '" + Form5.txtmember.Text + "'"
Set rsReport = adoSql.Execute(strSQLStatement)
If rsReport.EOF Then
MsgBox " No Record Found", vbCritical, "Status"
Else
Set Report = Appl.OpenReport("D:\PSM ODBC\Laporan\Report2.rpt")
Screen.MousePointer = vbHourglass
CRViewer91.ReportSource = Report
CRViewer91.Zoom 70
CRViewer91.ViewReport
Screen.MousePointer = vbDefault
End If
adoSql.Close
End Sub|||ur code looks fine, but the problem isn't in the code, if u using external rpt files u have to UNCHECK this option: file>>save data with report , like this image:
http://yoyo911.spymac.net/images/Crystal_Problem.JPG
by the way using designer(my example) is better, coz no one can edit the design of the reports as there is no external .rpt files.
i hope this help u.
bye|||hi joe...
i'm sorry again but it't not work.
what do you mean external.rpt?|||what i meant by external.rpt is the report file,
i use the designer, it is something like the data report (means no rpt file needed, the report will be included in the .rpt file)
to use the deigner, just select project>>add crystal reports 9>>from existing report>>browse the report.
about ur problem : r u sure that u removed the true sign from the option Save data with report?
and try to use the way explained above.|||yup...i've uncheck Save data with report just like u said.
i'll try u'r to use the designer. hope it will works...
TQ again|||hi,
just figured u forgot this line:
CRViewer91.ReportSource = Report
Report.Database.SetDataSource rsReport, 3, 1|||i have try that line but have an error.
i though because i use sql server.
the example that u give to me use access as database.
what is 3, 1 mean?
Report.Database.SetDataSource rsReport, 3, 1|||sorry, i forgot that!
The syntax for SetDataSource is as follows:
[form] Object.SetDataSource data, DataTag, tableIndex
i think this method applies only for the designer as i didn't try it b4 with .rpt file,
try using this way and see what happens|||thank...i will try that code.
i really hope it works.
my due date is very near to present my system.|||hi...i still can't priview the report just like i want. it has an error. can u tell my how to solve this problem using data report in VB?|||Dear,
We r working with crystal reports 9 designer not Data Report!
would u plz send me ur project to this mail: joe911_2003@.yahoo.com|||hai joe...
i've settle my problem.
thank u for your attention and help.|||happy u passed ur problen.
would u plz tell me what was that?
thnx bye|||hi joe..
actually i'm not solve my problem the way that i want. tomorrow i must present my system so i don't have time to try solve my problem the way that i want. cause i don't know what is wrong...so i just use group method in crystal report.
the problem when i use this method is, the report will show all receipt num and i must search the receipt num that i want. when i klik that receipt number, it will display subreport that contain all the information about the receipt num. that the way that i see right now..don't know what the judge will say about that in my presentation tomorrow...
by the way thank cause your help and idea...hope i can try to solve that problem after my presentaion.
Monday, February 20, 2012
Preventing overlapping data entry
Hello Everyone,
I have a web form that allows the user to select a time to reserve. I am trying to make it so that when a user selects a date to schedule something (which i have working) a drop down list will fill with times that have not been reserved.
The data is stored in two tables: tblCalendar and tblTime. tblTime contains pkTimeID and times (which are all possible times to select from in half hour intervals). tblCalendar contains a few fields but timeID and date (which is in the format M/d/yyyy) are what I need to test against. timeID is the foreign key of pkTimeID.
Basically when the user selects the date, a function gets called that will run a SELECT statement to get the times available. All of this works, I am able to fill the ddl with all times available no matter what the date is or what has already been reserved. I want to check if a time has been already selected based on the date selected by the user and only allow times not selected to be listed.
After acheiving this I would like to prevent the immediate time before and immediate time after from being displayed because each reserved time will last for one hour but the data is stored in half hour increments.
Any help/suggestions/links will be greatly appreciated. If I need to provide anything else please let me know.
Thanks in advance,
Brian
This query should give you the timeIDs that have not been scheduled:
SELECT t.pkTimeIDFROM tblTime tWHERE t.pkTimeIDNOT IN (SELECT c.timeIDFROM tblCalendar cWHERE c.date ='4/20/2007' )Replace the date with the date the user has selected.|||
This query leaves out the prior and next time slots to avoid overlapping a one hour appointment.
SELECT t.pkTimeIDFROM tblTime tWHERE t.pkTimeIDNOT IN (SELECT unavailableTimes.timeIDFROM (SELECT c.timeID, c.dateFROM tblCalendar cLEFTJOIN tblTime tON t.pkTimeID = c.timeIDUNION SELECT t1.pkTimeID, c.dateFROM tblCalendar cLEFTJOIN tblTime tON t.pkTimeID = c.timeIDLEFTJOIN tblTime t1ON t1.time =SUBSTRING(CONVERT(VARCHAR(20),DATEADD(n, -30, c.date +' ' + t.time)), 14, 7)UNION SELECT t2.pkTimeID, c.dateFROM tblCalendar cLEFTJOIN tblTime tON t.pkTimeID = c.timeIDLEFTJOIN tblTime t2ON t2.time =SUBSTRING(CONVERT(VARCHAR(20),DATEADD(n, 30, c.date +' ' + t.time)), 14, 7) ) unavailableTimesWHERE unavailableTimes.date ='4/20/2007' )This query is not optimal but you get the idea. Again, replace the date with the date the user has selected. You may also need to tweak the SUBSTRING params based on the format of your DATETIMEs.|||
Thank you so much for your help. I think I was a little to vague on my description but this solution helped me get a solution that worked for me. I needed to check for the previous and next pkTimeID value to eliminate not the actual datetime values. Just to keep this short my statement is as follows:
SELECT t.pkTimeID, t.timeFROM tblTime tWHERE t.pkTimeIDNOT IN (SELECT c.timeID - 1FROM tblCalendar cUNIONSELECT c1.timeIDFROM tblCalendar c1UNIONSELECT c2.timeID + 1FROM tblCalendar c2WHERE (c2.[date] ='4/20/2007'))
Thank you again for your help, and if you have any suggestions on how I might improve what I did come up with I would appreciate it. This is my first "real" project in the work place and I would like to learn the best way to approach a problem where ever I can, so that I will not have to learn these things later.
Brian