Page 1 of 2 12 LastLast
Results 1 to 40 of 48

Thread: Details Section format, paylip-like report. landscape division

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Details Section format, paylip-like report. landscape division

    Hi..

    I wonder if it is possible to create a report like payslip however
    the there should only be 2 employees' payslip per page.
    like in the image here.

    Should I make a subreport here?

    Name:  Capture.jpg
Views: 1481
Size:  11.7 KB

  2. #2
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    I guess it's achievable in Crystal Report, but you will be doing a very lot of work...

    you can use a Subreport. And a lot of formulas to ensure that you can have 2 Employees per page.

    ---

    The 1st thing you need to solve is, how will you take 2 employess? Are there Employee IDs in numeric order?

    What if Employee 2 is deleted and Employee 1 is the first on the list, how will CR take the next employee?

    It's hard to think though... *sigh*
    Last edited by terry002; Oct 30th, 2014 at 10:26 PM.
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    Quote Originally Posted by terry002 View Post

    The 1st thing you need to solve is, how will you take 2 employess? Are there Employee IDs in numeric order?

    What if Employee 2 is deleted and Employee 1 is the first on the list, how will CR take the next employee?

    It's hard to think though... *sigh*

    I will be pulling up the data using a query so there is a possibility that there will be lots of employees. and there will only be one record per employee. It doesnt matter if an employee is deleted.

  4. #4
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    here's the catch how can you tell the 2nd Subreport that he will be printing the next record?

    That's what I'm worrying about...
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    That's where I'm getting trouble. If there will only be one employee per page, that's a piece of cake

  6. #6
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    That's true... man that's the hard part....

    Is it requested by the client?
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  7. #7
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    You can do it actually, now I know,

    You need to put your records to be printed inside a VIRTUAL TABLE in your SQL, with a TRACE NO. (1-# of records in your virtual table)

    With that you can put a formula in your CR that it will print the next TRACE NO. (From your virtual table)... Something like that logic...

    With that kind of scenario, you can use the 2 subreports.

    I don't have so much time since we are just halfday today here in the office and will be leaving in a while.
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    yeah.
    inserting another Details Section will not help as well.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    are u in the philippines?

  10. #10
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Another tip:

    Use GLOBAL VARIABLE, because you will use it in both of your SUBREPORTS... (UPDATE IT PER SUBREPORT)

    Can't elaborate it yet, but I know it will work.

    ---

    To answer your question (thumbs up)

    I know you're from the Phils. from your 1st post about your payslip some time ago.
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    will try researching your suggestions. hoping for luck Thanks!

  12. #12
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Your Virtual Table will be like your Payslip Table

    You will just add 1 column for your tracing number 1 to Number of records.

    That will be your guide in printing your payslip. and tell the CR which records it will print.

    ---

    Will be logging back next week... gtg! goodluck! ^_^
    Last edited by terry002; Oct 30th, 2014 at 10:55 PM.
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    Ah sorry..this is going to be a different format.

    There will be multiple records per employee in this case.



    Name:  Capture.jpg
Views: 10505
Size:  34.4 KB

  14. #14
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    There will be multiple records per employee in this case.
    So did you finished working on it?
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    not yet,,,just figured out that the query will return multiple records per employee

  16. #16
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Quote Originally Posted by bjay_tiamsic26 View Post
    not yet,,,just figured out that the query will return multiple records per employee
    It means you have 2 tables?

    Am I correct?

    You can still use 2 subreports then.

    ---

    I think we are the only two who talks in this thread, so we can use our native language then...
    Last edited by terry002; Nov 4th, 2014 at 02:12 AM.
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    ahaha, i guess so.
    hmm no...
    At first i thought there will only be one record per employee but now
    there will be multiple...

    ganto po kakalabasan..

    Name:  Capture.PNG
Views: 1073
Size:  9.1 KB

    there are specifically 2 employees in that table (the image)

  18. #18
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Ganito gawin mo 2 subreports (pero same format):

    Dapat yang data mo naka virtual table yung isa.

    I guess yung 1st column mo dyan e yung Employee number (key mo yan sa inner join mo).

    Sa virtual table gagawin mo, same ng Employee table Schema, the difference is maglalagay ka ng isang (1 ) column (auto-Number) this will be your key in telling the Crystal Report kung anu priprint nya sa page na yun. (kunin mo lang ang kailangan mo)

    Basically you will start with ID 1 and 2 para sa 1st page and 3 and 4 sa 2nd Page.

    Tapos from ijoin mo yung virtual table mo dyan sa table na yan

    Sample Data:

    Rowstamp---|---Emp No.---|---Name---|---Time In---|---Time Out---|
    1 |900151 |Juan Cruz | 15:30 |16:45 |
    1 |900151 |Juan Cruz | 14:00 |16:45 |
    1 |900151 |Juan Cruz | 15:30 |16:45 |

    Ngayon multiple data yan, lalagay mo Header part yung dapat 1 lang ang lalabas.

    Tapos sa Detail part yung sinasabi mong multiple data.
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  19. #19

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    sge po try ko..
    1st time ko magvirtual table, pero nakakuha nko reference..
    ill get back on this thread po pag may problem or nasolve ko na hehe
    salamat!

  20. #20
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Unti untiin natin, gawin mo muna yung sa Virtual table before tayo punta sa next step, mahirap magmadali. masmaganda kung pulido ang ginagawa saka tayo punta sa next.

    Tutorials:
    http://www.mssqltips.com/sqlserverti...ble-variables/
    Last edited by terry002; Nov 4th, 2014 at 03:14 AM.
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  21. #21

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    I was able to create a virtual table na po

    DECLARE @virtualTKAA TABLE
    (
    ID int IDENTITY not null,
    EmployeeNo nvarchar(10),
    EmployeeName nvarchar(120)
    )


    INSERT INTO @virtualTKAA (EmployeeNo,EmployeeName)
    select distinct EmpNo, (Select LastName +', ' +FirstName from dbo.viewEmploymentHistory where EmployeeNo = tkAA.EmpNo ) as EmpName from [dbo].[TimeKeeping_Details_AA] tkAA where cutoffid=2

    Select * from @virtualTKAA

  22. #22

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    I have two main tables po na pnagkukunan,
    Timekeeping_Details ung multiple values
    Timekeeping_Summary yan po ung mga summation, so isang record sa isang employee lang

  23. #23

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    pano ko po sasabhin kay crystal report na 1 & 2 for page 1?

  24. #24

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    Quote Originally Posted by bjay_tiamsic26 View Post
    I have two main tables po na pnagkukunan,
    Timekeeping_Details ung multiple values
    Timekeeping_Summary yan po ung mga summation, so isang record sa isang employee lang

    never mind this reply po

  25. #25
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Kaya 2 sub reports gagamitin mo, kasi may GLOBAL variable ka, which contains your "Auto-number" ID. (starts from 1 to number of records)

    bawat galaw ng Sub Report, nag uupdate yung Variable na yun, which yun ang gagamitin mo para sa sub reports.

    For Example (initializing Global Numbervar from your Main Report to 1):

    Sub report 1 (hahanapin nya si ID 1):
    Global Numbervar ID;

    //After magprint ni Sub Report 1
    ID := ID + 1
    // so it means ID = 2

    Subport report 2 (hahanpin nya si ID 2):
    Global Numbervar ID;

    //After magprint ni Sub Report 2
    ID := ID + 1
    //magiging ID = 3

    Tuloy natin bukas ang pag uusap, out na kasi namin sa office. ^_^
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  26. #26

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    sge po..

    ill try to research incrementing global variable.

    may function po ba para malaman ni crystal report na tapos na magprint si Subreport 1 sa page 1?

  27. #27
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    I haven't tried it yet actually, parang pure logic pa lang yan, kasi di pa naman pinapagawa sa akin ang ganyang project. try ko minsan.
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  28. #28
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Update:

    Di pala pwede gamitin yung FORMULA (SHARED VARIABLES) sa Subreports, hahaha! sakit din pala sa ulo pinapagawa ng client mo... :P
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  29. #29
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Ei @bjay_tiamsic26...

    just found a solution for your INQUIRY...

    tried and tested...

    Name:  Untitled.jpg
Views: 863
Size:  11.6 KB
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  30. #30

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    Wow!

    Will you share it? hehe .. pleaseeeeeee

  31. #31
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Requirements:

    2 - tables
    1 - Subreport
    1 - Crystal Formula

    ---

    1st table - (same fields from your Main Source), with additional field ID or something that MUST be AUTO INCREMENTED
    2nd table - same fields as your 1ST TABLE, the difference is the ID field is NOT AUTO INCREMENTED. Why? because it will be your EVEN ID TABLE...

    ---
    1. INSERT all the data you need from your 1st table, I'm sure it will be numbered automatically.(1 - # of records)
    2. From the 1st table make use of INSERT SELECT statement and INSERT all the EVEN IDs by using the WHERE Clause "WHERE ID mod 2 = 0"

    ---

    In your Crystal Report:
    1. Make your MAIN REPORT as table 1. (be sure to SELECT ONLY THE ODD IDs)
    2. Create a FORMULA, that will be the LINK to your SUBREPORT. formula must be (ID of your MAIN REPORT + 1)
    2. Create a SUBREPORT for your EVEN TABLE then CHANGE THE SUBREPORT link to your formula...

    Like the one attached above... Napansin mo ba yung System ID sa right ay same sa FORMULA sa kanan>?

    Madali lang pala... ginawa ko lang ng 10 mins.

    Kung Auto-Incremented ang field mo sa 1ST TABLE, dapat mareset mo sya sa 1... para wala problema ang source mo.
    Last edited by terry002; Nov 12th, 2014 at 12:31 AM.
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  32. #32

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    still need to create a virtual table in this case correct?
    Do you have sample of the project?
    Last edited by bjay_tiamsic26; Nov 12th, 2014 at 11:24 PM.

  33. #33
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Nope I don't have a sample project,

    I just tested the database tables that I have here in the office.

    About Virtual tables, if you want to use that kind of style, you need to make your SOURCE as a Stored Procedure.

    But if you don't know how, you need to use a Physical table, which the records are deleted and refreshed everytime you print your payslip.
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  34. #34

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    can you guide me step by step?
    do you have hangout hehe?

  35. #35
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    naka-provide na yung step by step, nasa taas na...
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  36. #36

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    Is there other way to make an additional field for my Main Table than creating a virtual table?
    1st table - (same fields from your Main Source), with additional field ID or something that MUST be AUTO INCREMENTED
    my maintable actually has an incrementing ID named AA_TkSummaryID

  37. #37

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    Here is my main table for the Main Report

    Name:  a.jpg
Views: 831
Size:  5.7 KB

    And here is my 2nd table, need to be in the subreport

    Name:  c2.jpg
Views: 949
Size:  26.0 KB

    Is your way can fit on this?

  38. #38
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    Create ka ng new table,

    yung main report mo, papasok mo yung data na andyan sa Main Table mo,

    Tapos lagyan mo ng Integer na nag-au-auto increment.

    yung 2nd report mo? naka-join sa main report mo?
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

  39. #39

    Thread Starter
    Addicted Member
    Join Date
    Sep 2011
    Posts
    163

    Re: Details Section format, paylip-like report. landscape division

    Quote Originally Posted by terry002 View Post

    yung 2nd report mo? naka-join sa main report mo?
    you mean the subreport?.. no, hindi ysa naka-join sa main report.

  40. #40
    Addicted Member
    Join Date
    Jul 2014
    Posts
    176

    Re: Details Section format, paylip-like report. landscape division

    I mean yung Main table mo, yung Details nya is yung nasa main report mo?

    So mangyayari dyan, yung 1st table mo i-jojoin mo sa 2nd table mo, <main table>.AAEmpno = <2nd table>.Empno
    If I had helped you...

    Don't forget to mark your Inquiry as RESOLVED...

    I will be glad if you can also give me some Reputation points in helping you (by Clicking Rate This Post)...

    Happy VB Coding Everyone!

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width